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

aio-libs / multidict / 37750283696
86%

Build:
DEFAULT BRANCH: master
Ran 08 Oct 2026 08:31AM 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

08 Oct 2026 08:30AM UTC coverage: 85.9%. Remained the same
37750283696

push

github

web-flow
Access hash table entries through typed pointers (#1741)

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

## What do these changes do?

Made every access to a hash table entry name the kind of table it
handles, instead of computing the entry size and the field offsets from
a kind read at run time.

- `htkeys_entries()`, `entry_at()` and `anystr_entry_at()` are replaced
by `HTKEYS_COMPACT_ENTRIES()` (an `entry_t *`) and
`HTKEYS_ANYSTR_ENTRIES()` (an `anystr_entry_t *`), indexed with plain
pointer arithmetic.
- `entry_hash()`, `entry_identity()` and `entry_is_hole()` are replaced
by `compact_entry_hash()`, `compact_entry_identity()`,
`compact_entry_is_hole()` and `anystr_entry_is_hole()`; an anystr
entry's hash and identity are read from its fields.
- The `freethreading.h` accessors are split the same way
(`load_compact_identity()`, `load_anystr_identity()`,
`replace_compact_key()`, ...), so neither `htkeys.h` nor
`freethreading.h` tests the kind.
- No loop tests the kind per pass: each walk has one literal loop per
kind, with the work on a match in a helper taking a constant kind. Probe
loops use `HTKEYSITER_FIND_COMPACT()` or `HTKEYSITER_FIND_ANYSTR()`, and
`md_eq()` has one scan per pair of kinds.
- `str_cmp()` moved to its own header, `_multilib/str_cmp.h`.

Duplicating the loops costs GCC inlining budget, which on the GIL build
pushed `md_get_one()` and `str_cmp()` out of line on the `d[key]` path.
To get it back, the cold paths (`to_dict()`, `popall()`, `merge()`, the
deletes after `update()`, equality, `isdisjoint()`, `in d.items()`, the
key cache of a CIMultiDict's plain `str` key and the C API's
foreach-key) are marked `COLD`, and the probe loops compare identities
by address before calling `str_cmp()`.

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

## Are there changes in behavior for the user?

No.

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

No. The kind of every entry access is visible at the call sit... (continued)

793 of 1586 branches covered (50.0%)

Branch coverage included in aggregate %.

9326 of 10194 relevant lines covered (91.49%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37750283696.1 08 Oct 2026 08:31AM UTC 98
85.9
GitHub Action Run
Source Files on build 37750283696
  • Tree
  • List 49
  • 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 #37750283696
  • 014e43d0 on github
  • Prev Build on master (#37742297551)
  • Next Build on master (#37758426748)
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