summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maximechevalierb@gmail.com>2021-05-05 16:36:36 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:34 -0400
commitad601cef8af4bc93a53c8437be4fe8749191f621 (patch)
tree7ec797bcc207703cbe9fa9f2a850a2f5b8e6e285
parente5f8b417862cf7a7d03c82067b9870151cd6ce28 (diff)
Update README.md
Add section documenting command-line arguments
-rw-r--r--README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index 0dc76bec4f..fcadb3edc6 100644
--- a/README.md
+++ b/README.md
@@ -57,6 +57,8 @@ make -j16 test-all
## Usage
+### Examples
+
Once YJIT is built, you can either use `./miniruby` from within your build directory, or switch to the YJIT version of `ruby`
by using the `chruby` tool:
@@ -73,6 +75,17 @@ You can dump statistics about compilation and execution by running YJIT with the
The machine code generated for a given method can be printed by adding `puts YJIT.disasm(method(:method_name))` to a Ruby script. Note that no code will be generated if the method is not compiled.
+
+### Options
+
+YJIT supports all command-line options supported by upstream CRuby, but also adds a few YJIT-specific options:
+
+ - `--disable-yjit`: turn off YJIT (enabled by default)
+ - `--yjit-stats`: produce statistics after the execution of a program (must compile with `cppflags=-DRUBY_DEBUG` to use this)
+ - `--yjit-call-threshold=N`: number of calls after which YJIT begins to compile a function (default 2)
+ - `--yjit-version-limit=N`: maximum number of versions to generate per basic block (default 4)
+ - `--yjit-greedy-versioning`: greedy versioning mode (disabled by default, may increase code size)
+
## Benchmarking
We have collected a set of benchmarks and implemented a simple benchmarking harness in the [yjit-bench](https://github.com/Shopify/yjit-bench) repository. This benchmarking harness is designed to disable CPU frequency scaling, set process affinity and disable address space randomization so that the variance between benchmarking runs will be as small as possible. Please kindly note that we are at an early stage in this project.