YJIT: reduce default exec mem size to 48MiB (#9685)

YJIT: reduce default exec mem size to 48MiB based

Based on user feedback from @jhawthorn and others.
Better for small and memory-constrained deployments.

NOTE: This commit should be included in the next Ruby 3.3.x point
release. @xrxr should we tag someone specific?
This commit is contained in:
Maxime Chevalier-Boisvert 2024-01-24 13:14:36 -05:00 committed by GitHub
parent 6b9317c9d5
commit 1702528258
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ The machine code generated for a given method can be printed by adding `puts Rub
YJIT supports all command-line options supported by upstream CRuby, but also adds a few YJIT-specific options: YJIT supports all command-line options supported by upstream CRuby, but also adds a few YJIT-specific options:
- `--yjit`: enable YJIT (disabled by default) - `--yjit`: enable YJIT (disabled by default)
- `--yjit-exec-mem-size=N`: size of the executable memory block to allocate, in MiB (default 64 MiB) - `--yjit-exec-mem-size=N`: size of the executable memory block to allocate, in MiB (default 48 MiB)
- `--yjit-call-threshold=N`: number of calls after which YJIT begins to compile a function. - `--yjit-call-threshold=N`: number of calls after which YJIT begins to compile a function.
It defaults to 30, and it's then increased to 120 when the number of ISEQs in the process reaches 40,000. It defaults to 30, and it's then increased to 120 when the number of ISEQs in the process reaches 40,000.
- `--yjit-cold-threshold=N`: number of global calls after which an ISEQ is considered cold and not - `--yjit-cold-threshold=N`: number of global calls after which an ISEQ is considered cold and not

View File

@ -81,7 +81,7 @@ pub struct Options {
// Initialize the options to default values // Initialize the options to default values
pub static mut OPTIONS: Options = Options { pub static mut OPTIONS: Options = Options {
exec_mem_size: 64 * 1024 * 1024, exec_mem_size: 48 * 1024 * 1024,
no_type_prop: false, no_type_prop: false,
max_versions: 4, max_versions: 4,
num_temp_regs: 5, num_temp_regs: 5,
@ -101,7 +101,7 @@ pub static mut OPTIONS: Options = Options {
/// YJIT option descriptions for `ruby --help`. /// YJIT option descriptions for `ruby --help`.
static YJIT_OPTIONS: [(&str, &str); 9] = [ static YJIT_OPTIONS: [(&str, &str); 9] = [
("--yjit-exec-mem-size=num", "Size of executable memory block in MiB (default: 64)"), ("--yjit-exec-mem-size=num", "Size of executable memory block in MiB (default: 48)"),
("--yjit-call-threshold=num", "Number of calls to trigger JIT"), ("--yjit-call-threshold=num", "Number of calls to trigger JIT"),
("--yjit-cold-threshold=num", "Global calls after which ISEQs not compiled (default: 200K)"), ("--yjit-cold-threshold=num", "Global calls after which ISEQs not compiled (default: 200K)"),
("--yjit-stats", "Enable collecting YJIT statistics"), ("--yjit-stats", "Enable collecting YJIT statistics"),