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

aio-libs / multidict / 37799616380
86%

Build:
DEFAULT BRANCH: master
Ran 08 Oct 2026 03:19PM 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

08 Oct 2026 03:18PM UTC coverage: 86.01%. Remained the same
37799616380

push

github

web-flow
Move to_dict() into to_dict.h and mark only later duplicates (#1756)

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

## What do these changes do?

Moves `to_dict()` out of `hashtable.h` into its own
`_multilib/to_dict.h`, and trims its use of the `collected` bitmap.

The outer loop only starts a chain walk at the first entry of a key, and
equal keys are first reached along the chain in increasing entry index
(the invariant #1752 relies on), so the walk's first match is that entry
itself. Only the later matches need a mark for the outer loop to skip. A
repeated probe slot is now caught by `index <= last`, as in
`md_walk_with_hash()`, instead of `bitmap_test_and_set()`. The loop over
a table without repeated keys is split per entry kind, instead of
choosing the entry layout on every entry.

Dropping the bitmap altogether, by testing each entry for being the
first of its key the way `keys()` does, was measured too and is slower
on every table with repeated keys (GIL +3..+31%, FT +3..+24%): every
later duplicate then pays a probe and a string compare where the bitmap
pays one bit test. Iterating `keys()` and calling `getall()` per key
would add a separate first-key walk and rehash every key on top of that.

The pure-Python backend is unaffected; its `to_dict()` groups through a
dict keyed by identity.

## 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
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes
- [ ] 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`

Instructions per `to_dict()` call, from callgrind with
`PYTHONHASHSEED=0`, bracketed around the calls and differenced between
10 an... (continued)

832 of 1664 branches covered (50.0%)

Branch coverage included in aggregate %.

9706 of 10588 relevant lines covered (91.67%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37799616380.1 08 Oct 2026 03:19PM UTC 100
86.01
GitHub Action Run
Source Files on build 37799616380
  • 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 #37799616380
  • 84c5412a on github
  • Prev Build on master (#37793096165)
  • Next Build on master (#37799903752)
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