Repository navigation
Outline md_get_all - #1727
Merged
Merged
Outline md_get_all#1727
Conversation
Automation signalsActivity patterns show signs of automation. Evidence
Last 5 PRs:
This is an automated analysis by AgentScan |
asvetlov
marked this pull request as ready for review
October 7, 2026 08:29
4 of 6 tasks
asvetlov
added a commit
that referenced
this pull request
Oct 7, 2026
<!-- Thank you for your contribution! --> ## What do these changes do? Drops `inline` from `_md_seen_test_and_add()` and `ALWAYS_INLINE static inline` from `md_walk_with_hash()` in `walk.h`, leaving both plain `static`, and removes the `md_walk_with_hash` rule from `tools/check_inlining.py` that #1701 added. GCC now keeps one out-of-line `md_walk_with_hash()` with `_md_seen_test_and_add()` inlined into it, shared by `getall` and `md_walk()`; `md_walk.constprop.0` goes away, and `md_get_all()` (outlined in #1727) folds back into `multidict_getall()`. `.text` shrinks by 2752 bytes on GIL and 1312 on FT. The cost is the indirect visitor call #1701 measured. Callgrind against `409f8d1a`, Ir per call: | build | operation | MultiDict | CIMultiDict | |---|---|---|---| | GIL 3.14.7 | `getall` | 840.0 -> 875.8 (+4.3%) | 888.3 -> 926.1 (+4.3%) | | GIL 3.14.7 | `getitem_istr` | +0.7% | unchanged | | FT 3.14.7t | `getall` | 860.4 -> 883.2 (+2.7%) | 906.6 -> 928.8 (+2.4%) | | FT 3.14.7t | `setitem_insert` | +1.4% | +2.2% | | FT 3.14.7t | `delitem` | +1.1% | -1.9% | | FT 3.14.7t | `setitem_replace` | -1.3% | -2.6% | | FT 3.14.7t | `iter_keys` | -3.6% | -3.4% | | FT 3.14.7t | `setitem_istr` | +0.6% | -3.3% | Every other row moved by under 1%. The FT rows other than `getall` do 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 - [x] I think the code is well written - [ ] Unit tests for the changes exist (N/A, no behavior change) - [x] Documentation reflects the changes (N/A) - [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` (N/A) - [x] Add a new news fragment into the `CHANGES/` folder - [x] `make doc-spelling` passes and any new technical words are added to `docs/spelling_wordlist.txt` Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov. <details> <summary>Agent run details (optional, for reviewers)</summary> 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 409f8d1` reports 120 of 320 functions differ on 3.14.7 and 140 of 324 on 3.14.7t; `multidict_getall` 59 -> 291 instructions on GIL with `md_get_all` folded in. Tests: `pytest -q --no-cov` on 3.10.17 (4093 passed) and 3.14.7t (4074 passed). Pure-Python leg not run, no Python change. `tools/check_inlining.py` passes on 3.14.7 and 3.14.7t (16 and 19 rules). Pre-commit and `make doc-spelling` pass. </details>
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?
Dropped
ALWAYS_INLINE static inlinefrommd_get_all(), making it a plainstaticfunction. GCC keeps one out-of-line copy shared bymultidict_getallandmultidict_proxy_getall, so the #1530 rule intools/check_inlining.pyno longer holds and was removed.Cost (callgrind, Ir per op, CPython 3.14.7):
getall+20 to +24 Ir, i.e. +2.4% GIL and +2.7 to +2.9% FT for bothMultiDictandCIMultiDict. On FT,setdefault_newmoved -1.5% andMultiDictcontains_hit-1.4%; nothing else moved more than 0.3%.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.txtAgent run details (optional, for reviewers)
MultiDict.getallCIMultiDict.getallMultiDict.getallCIMultiDict.getallMeasured with
benchmarks/callgrind_driver.py --include-multidict-onlyagainst 1a94ccd.Tests:
pytest -qpassed with the C extension on 3.14, 3.14t and 3.10, and withMULTIDICT_NO_EXTENSIONS=1 --no-c-extensionson 3.14.Inlining:
tools/check_inlining.pyok on 3.14.7 and 3.14.7t.Docs:
make doc-spellingpassed.Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.