Skip to content

Update ZJIT docs#15449

Merged
tekknolagi merged 6 commits intoruby:masterfrom
tekknolagi:mb-more-zjit-doc
Dec 8, 2025
Merged

Update ZJIT docs#15449
tekknolagi merged 6 commits intoruby:masterfrom
tekknolagi:mb-more-zjit-doc

Conversation

@tekknolagi
Copy link
Contributor

No description provided.

@tekknolagi tekknolagi requested a review from a team December 8, 2025 15:47
doc/jit/zjit.md Outdated

## Documentation

<h3 id="command-line-options">Command-Line Options</h3>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to be a subset of --help? It seems weird to skip --zjit-stats, for example.

ruby/zjit/src/options.rs

Lines 127 to 144 in 2ed287d

pub const ZJIT_OPTIONS: &[(&str, &str)] = &[
("--zjit-mem-size=num",
"Max amount of memory that ZJIT can use in MiB (default: 128)."),
("--zjit-call-threshold=num",
"Number of calls to trigger JIT (default: 30)."),
("--zjit-num-profiles=num",
"Number of profiled calls before JIT (default: 5)."),
("--zjit-stats[=quiet]", "Enable collecting ZJIT statistics (=quiet to suppress output)."),
("--zjit-disable",
"Disable ZJIT for lazily enabling it with RubyVM::ZJIT.enable."),
("--zjit-perf", "Dump ISEQ symbols into /tmp/perf-{}.map for Linux perf."),
("--zjit-log-compiled-iseqs=path",
"Log compiled ISEQs to the file. The file will be truncated."),
("--zjit-trace-exits[=counter]",
"Record source on side-exit. `Counter` picks specific counter."),
("--zjit-trace-exits-sample-rate=num",
"Frequency at which to record side exits. Must be `usize`.")
];

All options shown in --help are supposed to be user-facing features, so I would show the same list of options in the doc and help.

Also, given that this will be another place that has something like --help, it'd be nice to keep its maintenance cost low by allowing to basically copy-paste one to the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied what seemed like relevant bits of YJIT's CLI. I can just reroute people to --help, too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see YJIT CLI docs)

Copy link
Member

@k0kubun k0kubun Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My experience from the YJIT doc maintenance is why I made the above comment. I would like the YJIT CLI doc to be fixed in the same way we fix it here.

I'm open to just rerouting people to --help to avoid the need of copy-pasting one to the other. But it seems useful for users to be able to see help while they're on the website without the need of running a ruby command. Maybe we could copy-paste the ZJIT section from the --help output if we want to just minimize the maintenance cost?

tekknolagi and others added 3 commits December 8, 2025 11:25
Co-authored-by: Stan Lo <stan001212@gmail.com>
Co-authored-by: Stan Lo <stan001212@gmail.com>
@st0012 st0012 added the Documentation Improvements to documentation. label Dec 8, 2025
@tekknolagi tekknolagi enabled auto-merge (squash) December 8, 2025 16:53
Copy link
Member

@k0kubun k0kubun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tekknolagi tekknolagi merged commit fd45496 into ruby:master Dec 8, 2025
62 checks passed
@tekknolagi tekknolagi deleted the mb-more-zjit-doc branch December 8, 2025 16:59
@tekknolagi tekknolagi linked an issue Dec 8, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZJIT: Shore up command-line options and docs

3 participants