Repository navigation
ci(codspeed): the memory job pins its thread pool, because peak is a race - #579
Merged
Merged
Conversation
…race The build is deterministic given a pool size: repeated runs produce identical chunk counts and identical bytes. Peak is not, because peak is max simultaneous liveness and whether two morsels are alive at the same instant is scheduling. Measured on transport/s, eight runs per arm: spread 1.5% at one thread, 3.2% at four, 3.6% at eight. The level moves further than the spread. Per-thread buffers dwarf a small model -- 176 MB, 194 MB, 216 MB at 1, 4 and 8 threads for a model whose frames total 4.27 MB -- and chunk count rises with the pool for the same data (sector/s: 4, 7, 13, 25 chunks at 1, 2, 4, 8, all at 590,000 bytes). memray counts allocations, so an unpinned pool measures the runner as much as the code. That is the s-rung instability seen on #578, a pull request whose entire diff is a YAML comment and which moved four benchmarks across a 30-point range. Only the memory job. The walltime job stays multi-threaded: polars is multi-threaded native code, single-threading it would measure something nobody runs, and its macro runner is dedicated hardware whose pool is already stable. PYTHONHASHSEED is not pinned beside it. Five seeds produced byte-identical chunk counts and sizes, so it would be a knob added on plausibility. This puts a step in the series at this commit; points before and after are not comparable and nothing makes them so. The trade is deliberate -- this job exists to make a series readable, and bench.yml with docs/benchmarks.md own the honest multi-threaded peak measured as RSS. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merging this PR will regress 2 benchmarks
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
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.
One env var on the memory job.
POLARS_MAX_THREADS: 1.Why
The build is deterministic given a pool size — repeated runs produce identical chunk counts and identical bytes. Peak is not, because peak is max simultaneous liveness, and whether two morsels are alive at the same instant is scheduling.
transport/s, eight runs per arm, whole-process peak:The level moves further than the spread does. Per-thread buffers dwarf a small model — 176 → 216 MB for a model whose frames total 4.27 MB — and chunk count rises with the pool for identical data:
memray counts allocations, so an unpinned pool measures the runner as much as the code. That is the
s-rung instability visible on #578 — a pull request whose entire diff is a YAML comment, which moved four benchmarks across a 30-point range (transport-s-lp+18.16%,sector-s-highs−12.15%).Scope, and what is not here
Memory job only. The walltime job stays multi-threaded: polars is multi-threaded native code, single-threading it would measure something nobody runs, and its macro runner is dedicated hardware whose pool is already stable.
PYTHONHASHSEEDis not pinned. Five seeds produced byte-identical chunk counts and sizes — it would be a knob added on plausibility rather than evidence.The cost, stated
This puts a step in the series at this commit. Points before and after are not comparable and nothing makes them so. The trade is deliberate: this job exists to make a series readable, and
bench.ymlwithdocs/benchmarks.mdown the honest multi-threaded peak measured as RSS.Follow-up worth testing separately: with one thread
sector/sdrops from 25 chunks to 4, so allocation counts fall sharply — themrung may now fit under CodSpeed's ~2M-allocation guidance that forced this job ontos.mis the rung where things are measurable.🤖 Generated with Claude Code