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

aio-libs / multidict / 37157837247
86%

Build:
DEFAULT BRANCH: master
Ran 03 Oct 2026 10:16PM 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 10:15PM UTC coverage: 85.966%. Remained the same
37157837247

push

github

web-flow
Drop entry_next and entry_prev in favour of entry_at (#1663)

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

## What do these changes do?

Removes `entry_next()`, `entry_prev()` and their `htkeys_entry_next()` /
`htkeys_entry_prev()` wrappers from `htkeys.h`. Every entry loop now
indexes with `entry_at()`, and loops that know the table is
`KIND_ANYSTR` use the new `anystr_entry_at()`, which returns an
`anystr_entry_t*` and so drops the `as_anystr()` casts. The loops that
kept a moving write cursor (`_md_rebuild()`, the resize to
`KIND_ANYSTR`, `_md_clone_after_holes()`) count with an index instead,
which leaves `htkeys_entry_index()` unused, so it goes too.

The pure Python implementation has no counterpart; this is C only.

## Are there changes in behavior for the user?

No.

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

No; one way to reach an entry instead of three.

The emitted code is a little slower, though. GCC strength reduced the
old pointer bump into a single `add`, and with indexing it sets up the
next entry's address with an extra `lea` (iteration) or a `mov` plus
`shl` (the index rebuild after a resize). Callgrind, against ee88f6c5:

| row | GIL | FT |
| --- | --- | --- |
| `iter_keys`, MultiDict | 51.1 -> 52.1 (+2.0%) | 87.5 -> 88.5 (+1.1%) |
| `iter_items`, MultiDict | 118.7 -> 119.7 (+0.8%) | 165.7 -> 166.7
(+0.6%) |
| `setitem_insert`, MultiDict | 373.6 -> 375.2 (+0.4%) | 556.7 -> 558.4
(+0.3%) |
| `add`, MultiDict | 461.3 -> 462.9 (+0.4%) | 641.9 -> 643.6 (+0.3%) |
| `popitem`, MultiDict | 485.4 -> 487.4 (+0.4%) | 536.0 -> 539.8 (+0.7%)
|

CIMultiDict moves the same way. Every other row is within 0.5 Ir.
Hoisting `pos->pos` into a local in `md_next()` / `md_prev()` fixed the
GIL iteration rows, but made FT 4 Ir worse, so the version here is the
cheapest one tried across both builds.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [ ] Unit tests for the changes exist: N/A, intern... (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 - 37157837247.1 03 Oct 2026 10:16PM UTC 98
85.96
GitHub Action Run
Source Files on build 37157837247
  • 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 #37157837247
  • b17e2d61 on github
  • Prev Build on master (#37149651226)
  • Next Build on master (#37187651832)
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