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

aio-libs / multidict / 37146282000
86%

Build:
DEFAULT BRANCH: master
Ran 03 Oct 2026 07:00PM 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 06:59PM UTC coverage: 85.966%. Remained the same
37146282000

push

github

web-flow
Compute the hash table entry size with sizeof (#1659)

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

## What do these changes do?

Drops `htkeys_kind_entry_shift()`, which encoded the entry size as
`(SIZEOF_VOID_P == 8 ? 4 : 3) + (kind != KIND_COMPACT)` and needed two
build asserts to stay in sync with the structs.
`htkeys_kind_entry_size()` now returns `sizeof(entry_t)` or
`sizeof(anystr_entry_t)`, and `entry_at()` multiplies by it. C extension
only; the pure-Python backend has no equivalent.

## Are there changes in behavior for the user?

No.

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

No; it removes code.

## 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; covered
by the existing suite)
- [ ] 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`

Cost: `entry_at()` with a runtime kind becomes `cmov` plus `imul`
instead of a shift, which costs 2.8 Ir on the MultiDict `getitem_hit`
row on the GIL build (+2.1%). Every other row stays within about 1% on
both builds; `entry_next()`/`entry_prev()` compile the same as before.
Three other spellings (typed pointer arithmetic, `entries + (i <<
!compact)`, `sizeof(entry_t) << !compact`) were measured too and
regressed iteration by 4 to 7.5%, because they stop GCC from
specializing the iterator loops per kind.

Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.

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

Callgrind (`benchmarks/callgrind_driver.py --include-multidict-only`,
PYTHONHASHSEED=0), base dd3227e5, rows moving 0.5% or more:

GIL (3.14.7):
```
-0.78%  delitem          multidict_c      255.7 ->   253.7
+0.65% ... (continued)

791 of 1582 branches covered (50.0%)

Branch coverage included in aggregate %.

9224 of 10068 relevant lines covered (91.62%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37146282000.1 03 Oct 2026 07:00PM UTC 98
85.96
GitHub Action Run
Source Files on build 37146282000
  • 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 #37146282000
  • 467f0964 on github
  • Prev Build on master (#37145249750)
  • Next Build on master (#37149148588)
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