Repository navigation
Make the remaining walk.h helpers plain static functions - #1722
Merged
Merged
Conversation
Mixed activityActivity patterns show a mix of organic and automated signals. Evidence
Last 5 PRs:
This is an automated analysis by AgentScan |
Merging this PR will degrade performance by 11%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| 👁 | test_cimultidict_getall_istr_hit_many_values[c] |
1.9 ms | 2.2 ms | -11.06% |
| 👁 | test_multidict_getall_str_hit_many_values[ci-c] |
1.9 ms | 2.1 ms | -11.64% |
| 👁 | test_multidict_getall_str_hit_many_values[cs-c] |
1.9 ms | 2.1 ms | -10.3% |
Comparing asvetlov:walk-h-plain-static (1c5cc5e) with master (409f8d1)
# Conflicts: # tools/check_inlining.py
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?
Drops
inlinefrom_md_seen_test_and_add()andALWAYS_INLINE static inlinefrommd_walk_with_hash()inwalk.h, leaving both plainstatic, and removes themd_walk_with_hashrule fromtools/check_inlining.pythat #1701 added.GCC now keeps one out-of-line
md_walk_with_hash()with_md_seen_test_and_add()inlined into it, shared bygetallandmd_walk();md_walk.constprop.0goes away, andmd_get_all()(outlined in #1727) folds back intomultidict_getall()..textshrinks by 2752 bytes on GIL and 1312 on FT.The cost is the indirect visitor call #1701 measured. Callgrind against
409f8d1a, Ir per call:getallgetitem_istrgetallsetitem_insertdelitemsetitem_replaceiter_keyssetitem_istrEvery other row moved by under 1%. The FT rows other than
getalldo not reach the changed code; they move with the layout of the smaller binary.Are there changes in behavior for the user?
No.
Is it a substantial burden for the maintainers to support this?
No.
Related issue number
N/A
Checklist
CONTRIBUTORS.txt(N/A)CHANGES/foldermake doc-spellingpasses and any new technical words are added todocs/spelling_wordlist.txtDrafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.
Agent run details (optional, for reviewers)
Measurement:
benchmarks/callgrind_driver.py --include-multidict-only --impl {multidict_c,cimultidict_c}, base and changed trees installed into separate venvs per build.Codegen:
tools/codegen_diff.py --ref 409f8d1areports 120 of 320 functions differ on 3.14.7 and 140 of 324 on 3.14.7t;multidict_getall59 -> 291 instructions on GIL withmd_get_allfolded in.Tests:
pytest -q --no-covon 3.10.17 (4093 passed) and 3.14.7t (4074 passed). Pure-Python leg not run, no Python change.tools/check_inlining.pypasses on 3.14.7 and 3.14.7t (16 and 19 rules). Pre-commit andmake doc-spellingpass.