Repository navigation
Scale up syscall-dominated CodSpeed benchmarks - #1485
Merged
asvetlov merged 1 commit intoSep 20, 2026
Merged
Conversation
Comparing repeated CodSpeed runs on the same master commit via the CodSpeed MCP showed pop, popitem, delitem, add and item-insertion benchmarks for the pure-Python backend consistently flagged as "dominated by syscalls": instrumentation mode cannot account for syscall time, so these measurements understate the real cost and vary from run to run depending on when a syscall happens to land. Scaling up the working set each benchmark does amortizes that overhead over more instrumented work, which is CodSpeed's own recommendation for this class of measurement noise. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Merging this PR will degrade performance by 74.75%
Performance Changes
Comparing |
asvetlov
marked this pull request as ready for review
September 20, 2026 11:14
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1485 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 37 37
Lines 5934 5934
Branches 514 514
=========================================
Hits 5934 5934
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
3 of 6 tasks
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 do these changes do?
Scales up the working set of the
pop(),popitem(),__delitem__(),add()and item-insertion CodSpeed benchmarks intests/test_multidict_benchmarks.py. Comparing repeated CodSpeed runson the same master commit (via the CodSpeed MCP) showed these
particular pure-Python-backend benchmarks consistently flagged as
"dominated by syscalls": instrumentation mode cannot account for
syscall time, so it is excluded from the measured value, which both
understates the real cost and introduces run-to-run noise depending
on when a syscall happens to land during the measured window. Giving
each benchmark more instrumented work to do amortizes that overhead,
which is CodSpeed's own guidance for this class of measurement issue.
Are there changes in behavior for the user?
No. Only the size of the fixtures inside these benchmark functions
changed; no library code is touched.
Is it a substantial burden for the maintainers to support this?
No, it is a mechanical change to existing benchmark fixture sizes.
Related issue number
N/A
Checklist
CONTRIBUTORS.txtCHANGES/foldermake doc-spellingpasses and any new technical words are added todocs/spelling_wordlist.txtAgent run details (optional, for reviewers)
Analysis: used the CodSpeed MCP to compare two runs of the same master
commit (
7310298, runs6aaf7cd3vs6aaf045b, and9c08be4, runs6aae2b4fvs6aad8528). Both comparisons flagged the same cluster ofpure-Python
pop/popitem/delitem/add/insert-style benchmarks as"dominated by syscalls"; no other benchmarks were flagged.
Tests:
pytest tests/test_multidict_benchmarks.py tests/test_views_benchmarks.py -qpassed (269 passed) against both thedefault C-extension build (built locally with
setup.py build_ext --inplaceto avoid touching the shared pyenv venv) and the pure-Pythonbackend (both backends are exercised in the same run via the
any_multidict_class-style fixtures). Could not reproduce an actualCodSpeed instrumentation run locally (that requires the CodSpeed cloud
runner's valgrind-based environment); correctness of the benchmark
code was verified, but the claim that this reduces the "dominated by
syscalls" flag can only be confirmed once this branch runs through the
CodSpeed action in CI.
Lint:
pre-commit runon the changed files (ruff, mypy, changelogfilename/user-role checks) passed.
make doc-spellingpassed afteradding
syscallstodocs/spelling_wordlist.txt.Drafted with Claude Code (Sonnet 5); reviewed by asvetlov.
🤖 Generated with Claude Code