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

aio-libs / multidict / 37187931224
86%

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

04 Oct 2026 08:02AM UTC coverage: 86.01% (+0.04%) from 85.966%
37187931224

push

github

web-flow
Drop md_pos_t and walk the hash table with explicit loops (#1662)

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

## What do these changes do?

Removes the C extension's `md_pos_t` cursor together with
`md_init_pos()`, `md_init_pos_reverse()`, `md_next()` and `md_prev()`.
The one-shot scans (`==` against a mapping, `items() - x`, `x |
items()`, `x | keys()`) now walk the entries in a plain loop, the same
shape as `md_repr()` and `md_walk_all()`, and recheck the version after
each step's Python code. The iterators keep their position and version
in the iterator object and step through a header-local
`_iter_next_entry()`. The unused `htkeys_entry_prev()` is dropped as
well.

A new test resizes the table from the first and from the last entry's
`__eq__`/`__hash__` during each scan; it passes before and after, so
behaviour is unchanged. The pure-Python backend has no cursor and is
untouched.

Instruction counts (callgrind driver, `PYTHONHASHSEED=0`, 3.14.7 and
3.14.7t, base `b17e2d61`):

| operation | GIL | FT |
| --- | --- | --- |
| `for k in d` (`iter_keys`) | -5.8% / -3.6% | -7.9% / -6.6% |
| `for k, v in d.items()` (`iter_items`) | +4.2% / +4.9% | +2.4% / +3.0%
|
| `d == dict` | -5% | -3% |
| `items()` set ops | -2% to -3% | about 0 |

(MultiDict / CIMultiDict where two numbers are given; the eq and set-op
rows were measured against `ee88f6c5`.) The `iter_items` cost is not in
the step itself, which is shorter than `md_next()` was: GCC now packs
key and value into an xmm register and spills it across the calls that
follow, and keeps `_Py_NewRef` out of line where the old shape inlined
it. Hinting the branch, a local position and `Py_INCREF` instead of
`Py_NewRef` did not change that; the trade is flagged here for review.

## Are there changes in behavior for the user?

No.

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

No, it removes a small internal API.

## Related issue number

N/A

## Checklist

- [x] I think the code is well wri... (continued)

792 of 1584 branches covered (50.0%)

Branch coverage included in aggregate %.

42 of 42 new or added lines in 1 file covered. (100.0%)

9266 of 10110 relevant lines covered (91.65%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37187931224.1 04 Oct 2026 08:08AM UTC 98
86.01
GitHub Action Run
Source Files on build 37187931224
  • Tree
  • List 49
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37187931224
  • a8821735 on github
  • Prev Build on master (#37157837247)
  • Next Build on master (#37194502182)
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