You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To cite YJIT in your publications, please cite the VMIL 2021 paper:
33
+
34
+
```
35
+
@inproceedings{yjit_vmil2021,
36
+
author = {Chevalier-Boisvert, Maxime and Gibbs, Noah and Boussier, Jean and Wu, Si Xing (Alan) and Patterson, Aaron and Newton, Kevin and Hawthorn, John},
37
+
title = {YJIT: A Basic Block Versioning JIT Compiler for CRuby},
38
+
year = {2021},
39
+
isbn = {9781450391092},
40
+
publisher = {Association for Computing Machinery},
41
+
address = {New York, NY, USA},
42
+
url = {https://doi.org/10.1145/3486606.3486781},
43
+
doi = {10.1145/3486606.3486781},
44
+
booktitle = {Proceedings of the 13th ACM SIGPLAN International Workshop on Virtual Machines and Intermediate Languages},
@@ -146,10 +154,10 @@ The machine code generated for a given method can be printed by adding `puts Rub
146
154
YJIT supports all command-line options supported by upstream CRuby, but also adds a few YJIT-specific options:
147
155
148
156
-`--yjit`: enable YJIT (disabled by default)
149
-
-`--yjit-call-threshold=N`: number of calls after which YJIT begins to compile a function (default 10)
150
-
-`--yjit-exec-mem-size=N`: size of the executable memory block to allocate, in MiB (default 256 MiB)
151
-
-`--yjit-stats`: produce statistics after the execution of a program (must compile with `cppflags=-DRUBY_DEBUG` to use this)
152
-
-`--yjit-trace-exits`: produce a Marshal dump of backtraces from specific exits. Automatically enables `--yjit-stats` (must compile with `cppflags=-DRUBY_DEBUG` to use this)
157
+
-`--yjit-call-threshold=N`: number of calls after which YJIT begins to compile a function (default 30)
158
+
-`--yjit-exec-mem-size=N`: size of the executable memory block to allocate, in MiB (default 128 MiB)
159
+
-`--yjit-stats`: produce statistics after the execution of a program
160
+
-`--yjit-trace-exits`: produce a Marshal dump of backtraces from specific exits. Automatically enables `--yjit-stats` (must configure and build with `--enable-yjit=stats` to use this)
153
161
-`--yjit-max-versions=N`: maximum number of versions to generate per basic block (default 4)
154
162
-`--yjit-greedy-versioning`: greedy versioning mode (disabled by default, may increase code size)
155
163
@@ -175,19 +183,7 @@ This section contains tips on writing Ruby code that will run as fast as possibl
175
183
- CRuby method calls are costly. Favor larger methods over smaller methods.
176
184
- Try to write code so that the same variables always have the same type
177
185
178
-
You can also compile YJIT in debug mode and use the `--yjit-stats` command-line option to see which bytecodes cause YJIT to exit, and refactor your code to avoid using these instructions in the hottest methods of your code.
179
-
180
-
### Memory Statistics
181
-
182
-
YJIT, including in production configuration, keeps track of the size of generated code. If you check `YJIT.runtime_stats` you can see them:
These are the size in bytes of generated inlined code and generated outlined code. If the combined sizes for generated code are very close to the total YJIT exec-mem-size (see above), YJIT will stop generating code once the limit is reached. Try to make sure you have enough exec-mem-size for the program you're running. By default YJIT will allocate 268,435,456 bytes (256 MiB) of space for generated inlined and outlined code.
186
+
You can also use the `--yjit-stats` command-line option to see which bytecodes cause YJIT to exit, and refactor your code to avoid using these instructions in the hottest methods of your code.
0 commit comments