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
Copy file name to clipboardExpand all lines: doc/jit/zjit.md
+41-8Lines changed: 41 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,35 @@ To build ZJIT on macOS:
16
16
make -j miniruby
17
17
```
18
18
19
+
To build ZJIT on Linux:
20
+
21
+
```bash
22
+
./autogen.sh
23
+
24
+
./configure \
25
+
--enable-zjit=dev \
26
+
--prefix="$HOME"/.rubies/ruby-zjit \
27
+
--disable-install-doc
28
+
29
+
make -j miniruby
30
+
```
31
+
32
+
Note that `--enable-zjit=dev` does a lot of IR validation, which will help to catch errors early but mean compilation and warmup are significantly slower.
33
+
34
+
The valid values for `--enable-zjit` are, from fastest to slowest:
35
+
*`--enable-zjit`: enable ZJIT in release mode for maximum performance
36
+
*`--enable-zjit=stats`: enable ZJIT in extended-stats mode
37
+
*`--enable-zjit=dev_nodebug`: enable ZJIT in development mode but without slow runtime checks
38
+
*`--enable-zjit=dev`: enable ZJIT in debug mode for development, also enables `RUBY_DEBUG`
39
+
40
+
### Regenerate bindings
41
+
42
+
When modifying `zjit/bindgen/src/main.rs` you need to regenerate bindings in `zjit/src/cruby_bindings.inc.rs` with:
43
+
44
+
```bash
45
+
make zjit-bindgen
46
+
```
47
+
19
48
## Documentation
20
49
21
50
You can generate and open the source level documentation in your browser using:
@@ -24,6 +53,16 @@ You can generate and open the source level documentation in your browser using:
24
53
cargo doc --document-private-items -p zjit --open
25
54
```
26
55
56
+
### Graph of the Type System
57
+
58
+
You can generate a graph of the ZJIT type hierarchy using:
Note that tests link against CRuby, so directly calling `cargo test`, or `cargo nextest` should not build. All tests are instead accessed through `make`.
@@ -139,14 +178,8 @@ end
139
178
140
179
### Performance Ratio
141
180
142
-
The `ratio_in_zjit` stat shows the percentage of Ruby instructions executed in JIT code vs interpreter. This metric only appears when ZJIT is built with `--enable-zjit=stats` (which enables `rb_vm_insn_count` tracking) and represents a key performance indicator for ZJIT effectiveness.
143
-
144
-
To build with stats support:
145
-
146
-
```bash
147
-
./configure --enable-zjit=stats
148
-
make -j
149
-
```
181
+
The `ratio_in_zjit` stat shows the percentage of Ruby instructions executed in JIT code vs interpreter.
182
+
This metric only appears when ZJIT is built with `--enable-zjit=stats`[or more](#build-instructions) (which enables `rb_vm_insn_count` tracking) and represents a key performance indicator for ZJIT effectiveness.
0 commit comments