• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aio-libs / multidict / 37110008949
86%

Build:
DEFAULT BRANCH: master
Ran 03 Oct 2026 08:32AM UTC
Jobs 1
Files 49
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Oct 2026 08:31AM UTC coverage: 85.928% (-0.05%) from 85.975%
37110008949

push

github

web-flow
Keep d[key] = v's duplicate collector off the stack (#1650)

<!-- Thank you for your contribution! -->

## What do these changes do?

`d[key] = v` carried a `reflist_t` with 15 inline slots in its frame on
every call, though only later duplicates of the key ever need it. The
replaced key and value now go into two locals released after the
critical section, and the collector for duplicates is allocated on the
heap the first time one turns up.

C extension only; the pure-Python implementation has no equivalent.

Callgrind driver, Ir per op vs `73e8bbd8`:

| row | GIL MultiDict | GIL CIMultiDict | FT MultiDict | FT CIMultiDict
|
| --- | --- | --- | --- | --- |
| setitem_replace | -4.4% | -4.9% | -3.9% | -4.1% |
| setitem_insert | -2.8% | -2.5% | -1.1% | -0.9% |
| setitem_istr | -4.6% | -5.7% | -1.2% | -4.7% |

Every other row is within 0.4%, except GIL MultiDict `getitem_istr`,
whose code is unchanged and which swings by about 3% in either direction
between driver builds; a direct bracketed harness put it at +0.04%. An
FT-only `ALWAYS_INLINE` on `_key_to_identity_cs` was needed before #1651
to keep `delitem` flat; after #1651 it no longer pays off and was
dropped.

Wall clock on an idle box (measured before merging #1651/#1653), base
and fix alternating on one pinned P-core, 15 rounds, median of the
per-round deltas (`dict` in the same processes stayed within 3%):

| row | GIL MultiDict | GIL CIMultiDict | FT MultiDict | FT CIMultiDict
|
| --- | --- | --- | --- | --- |
| setitem_replace | -11.4% | -12.4% | -9.0% | -5.8% |
| setitem_insert | -2.9% | -8.9% | -2.1% | -5.7% |
| setitem_istr | -3.1% | -6.3% | +1.8% | -6.4% |

`delitem`, `add`, `getitem_hit`, `getitem_istr` and `ctor_items` came
out within their own interquartile range of zero on both builds.

## 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 wr... (continued)

791 of 1582 branches covered (50.0%)

Branch coverage included in aggregate %.

35 of 47 new or added lines in 2 files covered. (74.47%)

9193 of 10037 relevant lines covered (91.59%)

1.83 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
74.11
-0.09% tests/test_capi.py
6
95.11
-0.51% tests/test_mutable_multidict.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37110008949.1 03 Oct 2026 08:32AM UTC 98
85.93
GitHub Action Run
Source Files on build 37110008949
  • Tree
  • List 49
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37110008949
  • 0d683ccf on github
  • Prev Build on master (#37058464713)
  • Next Build on master (#37112485399)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc