summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Lo <stan.lo@shopify.com>2025-10-01 22:02:48 +0100
committerGitHub <noreply@github.com>2025-10-01 14:02:48 -0700
commit1ef62d3fe7e2d0ef3db6a008afdd5f2ba68cdbd1 (patch)
treec3404cfe146d22118a08ea77311dc95e5a6e0e74
parent77aaa6ab0a475b8a57b1de4aa1f1210e4f85a803 (diff)
ZJIT: Allow higher profile num (#14698)
When we investigate guard failure issues, we sometimes need to use profile num around 100k (e.g. `lobsters` in ruby-bench). This change is to allow that.
-rw-r--r--zjit/src/options.rs8
-rw-r--r--zjit/src/profile.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/zjit/src/options.rs b/zjit/src/options.rs
index 4040c85907..1bfd0a91af 100644
--- a/zjit/src/options.rs
+++ b/zjit/src/options.rs
@@ -6,7 +6,7 @@ use crate::cruby::*;
use std::collections::HashSet;
/// Default --zjit-num-profiles
-const DEFAULT_NUM_PROFILES: u8 = 5;
+const DEFAULT_NUM_PROFILES: u32 = 5;
/// Default --zjit-call-threshold. This should be large enough to avoid compiling
/// warmup code, but small enough to perform well on micro-benchmarks.
@@ -40,7 +40,7 @@ pub struct Options {
pub mem_bytes: usize,
/// Number of times YARV instructions should be profiled.
- pub num_profiles: u8,
+ pub num_profiles: u32,
/// Enable YJIT statsitics
pub stats: bool,
@@ -112,9 +112,9 @@ pub const ZJIT_OPTIONS: &[(&str, &str)] = &[
("--zjit-mem-size=num",
"Max amount of memory that ZJIT can use (in MiB)."),
("--zjit-call-threshold=num",
- "Number of calls to trigger JIT (default: 2)."),
+ "Number of calls to trigger JIT (default: 30)."),
("--zjit-num-profiles=num",
- "Number of profiled calls before JIT (default: 1, max: 255)."),
+ "Number of profiled calls before JIT (default: 5)."),
("--zjit-stats[=quiet]", "Enable collecting ZJIT statistics (=quiet to suppress output)."),
("--zjit-perf", "Dump ISEQ symbols into /tmp/perf-{}.map for Linux perf."),
("--zjit-log-compiled-iseqs=path",
diff --git a/zjit/src/profile.rs b/zjit/src/profile.rs
index f73138d4bd..471ff89e76 100644
--- a/zjit/src/profile.rs
+++ b/zjit/src/profile.rs
@@ -278,7 +278,7 @@ pub struct IseqProfile {
opnd_types: Vec<Vec<TypeDistribution>>,
/// Number of profiled executions for each YARV instruction, indexed by the instruction index
- num_profiles: Vec<u8>,
+ num_profiles: Vec<u32>,
}
impl IseqProfile {