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

aio-libs / multidict / 38225593874
86%

Build:
DEFAULT BRANCH: master
Ran 12 Oct 2026 08:47AM UTC
Jobs 1
Files 50
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

12 Oct 2026 08:45AM UTC coverage: 86.054%. Remained the same
38225593874

push

github

web-flow
Pass the table size to the index macros explicitly (#1774)

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

## What do these changes do?

`HTKEYS_GET_INDEX()`, `HTKEYS_SET_INDEX()` and their acquire and publish
variants read `keys->log2_size` on every call to pick the index width.
The extension is built with `-fno-strict-aliasing`, so any store may
alias that byte and GCC reloads it, and redoes the width dispatch, on
every probed slot.

The macros now take `log2_size` as an argument. The loops that probe for
a free slot (`_htkeys_find_empty_slot_noting_dups()`, the resume probe
and the index rebuild) read it once; every other caller passes
`keys->log2_size` and compiles as before. A debug build asserts that the
argument matches the table. The pure-Python backend is unchanged.

Caching `log2_size` in `htkeysiter_t` as well was tried and dropped: GCC
then unswitched every lookup loop, which saved 3.8% on GIL `delitem` but
made the FT lock-free `contains_hit` and `getitem_hit` up to 4.5% slower
and `update` 1% to 2% slower on both builds.

## Are there changes in behavior for the user?

No.

## Is it a substantial burden for the maintainers to support this?

No, the index macros take one more argument.

## Related issue number

None.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist (existing tests; no behaviour
change)
- [x] Documentation reflects the changes (N/A, no API change)
- [ ] 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`

<details>
<summary>Agent run details (optional, for reviewers)</summary>

`benchmarks/callgrind_driver.py --include-multidict-only`, 64a6b716 vs
this PR, 3.14.7 and 3.14.7t; every row that moved by 0.5% or more:

| operation | GIL MultiDict | GIL CIMultiDict | FT MultiDict | FT
CIMultiDict |
|---... (continued)

832 of 1664 branches covered (50.0%)

Branch coverage included in aggregate %.

9757 of 10641 relevant lines covered (91.69%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 38225593874.1 12 Oct 2026 08:47AM UTC 100
86.05
GitHub Action Run
Source Files on build 38225593874
  • Tree
  • List 50
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #38225593874
  • 886e6e79 on github
  • Prev Build on master (#38225306936)
  • Next Build on master (#38229223837)
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