feat(snmalloc-rs): linux-pinned bench harness for ticket 86aj0jg36#77
Open
jayakasadev wants to merge 1 commit into
Open
feat(snmalloc-rs): linux-pinned bench harness for ticket 86aj0jg36#77jayakasadev wants to merge 1 commit into
jayakasadev wants to merge 1 commit into
Conversation
…t 86aj0jg36
Adds snmalloc-rs/scripts/run-linux-pinned-bench.sh which executes the
recipe described in ticket 86aj0jg36 on a bare-metal Linux desktop so
the residual idle/active overhead numbers can be measured below the
macOS bench harness's ~4-7% sigma. The script:
* saves cpufreq governor, boost flag, and SMT-sibling online state;
* locks all cpus to "performance", disables turbo/boost, and offlines
the SMT sibling of the bench cpu so the bench thread owns its
physical core's L1/L2 alone;
* best-effort stops snapd / packagekit / unattended-upgrades / cron;
* runs `cargo bench --features profiling --bench profile_bench` with
`taskset -c <cpu>` (default cpu0);
* extracts target/criterion/*/new/estimates.json into a paste-ready
markdown summary + JSON archive + host-fingerprint sidecar;
* always restores host state on exit via an EXIT trap.
Also bumps `medium_allocs` and `mixed` groups in profile_bench.rs from
sample_size=50/measurement_time=5s to 200/20s per the ticket spec. The
`small_allocs` group is already noise-dominated at the old settings and
is left alone. The new settings cost ~10 minutes per run instead of ~4.
Outputs land under snmalloc-rs/bench-results/ by default (configurable
via --output-dir). Push the generated linux-pinned-bench.{log,json,md}
plus linux-pinned-bench-host.txt back here in a follow-up commit to
close ticket 86aj0jg36.
Usage:
sudo ./snmalloc-rs/scripts/run-linux-pinned-bench.sh # defaults
sudo ./snmalloc-rs/scripts/run-linux-pinned-bench.sh --cpu 2 --out /tmp/bench
sudo ./snmalloc-rs/scripts/run-linux-pinned-bench.sh --no-offline-smt
sudo ./snmalloc-rs/scripts/run-linux-pinned-bench.sh --dry-run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
snmalloc-rs/scripts/run-linux-pinned-bench.sh— one-shot Linux desktop bench runner that does setup, run, extract, cleanup for the heap-profiling perf ticket 86aj0jg36.Also bumps
medium_allocs+mixedgroups inprofile_bench.rsfromsample_size=50 / measurement_time=5sto200 / 20sper ticket spec.small_allocsleft alone (already noise-dominated).Why
macOS M4 Pro variance (~4-7% σ) > residual perf gap (<1% target). Confirmed today: with the new sample bump on macOS,
mixed/profile-on-inactivehit a 113% CoV cell — thermally throttled / scheduler-migrated during a 20s sustained run. Not decisive.Ticket calls for: bare-metal Linux desktop,
taskset -c 0,cpufreq -g performance, no turbo, no SMT sibling. Script automates the full recipe so the result is reproducible.Script extracts the criterion JSON into a paste-ready markdown table + JSON archive + host fingerprint sidecar — drop the four output files in a follow-up commit on this branch and the ticket closes.
Cost
workflow_dispatch-style — user invokes on their own Linux box).target/criterion/.profile_bench.rs.Evidence
bash -nclean.shellcheckclean modulo two false-positive disables (SC2294 eval-with-redirect is intentional for--dry-run; SC2054 misreads--preserve-env=HOME,PATH,...commas as array separators).cargo check --bench profile_bench --features profilingclean after theprofile_bench.rsbump.apply_setup, restored viabash $STATE_FILEin EXIT trap regardless of success/fail/Ctrl-C.Follow-up
sudo ./snmalloc-rs/scripts/run-linux-pinned-bench.shon Linux desktop.snmalloc-rs/bench-results/linux-pinned-bench.{log,json,md}+linux-pinned-bench-host.txtto this branch.docs/heap-profiling-benchmarks.mdwith the Linux column.