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

aio-libs / multidict / 37441182416
86%

Build:
DEFAULT BRANCH: master
Ran 06 Oct 2026 09:11AM 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

06 Oct 2026 09:10AM UTC coverage: 85.961%. Remained the same
37441182416

push

github

web-flow
Move the istr constructor's slow paths into one cold helper (#1694)

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

## What do these changes do?

`istr(x)` and `IStr_New()` both build an `istr` from anything other than
an exact `str` by packing it into a tuple for `str.__new__()`. That code
now lives in one `COLD` helper, `_istr_from_object()`, so only the
exact-str branch stays on the hot path. The one-call
`_istr_from_object()` helper that `istr_tp_vectorcall()` used is folded
into it, the call to `_istr_slow_vectorcall()` is marked `UNLIKELY`, and
`IStr_New()` drops its `inline` hint; GCC keeps it out of line by
itself.

The C extension's `.text` shrinks by 768 bytes on GIL and 1600 bytes on
FT. Constructing an `istr` from a `str` or an `istr`, and iterating a
`CIMultiDict`, cost the same; the cold paths (`istr()` of a `str`
subclass or of a non-str) cost 6 to 7 more instructions. Pure Python has
no equivalent.

## 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
- [ ] Unit tests for the changes exist (N/A, no behavior change; the
existing istr tests cover every path)
- [x] 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`

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`,
3.14.7 and 3.14.7t, `PYTHONHASHSEED=0`, equal-length trees and venvs. Ir
per op, rows that moved:

| op | GIL | FT |
| --- | --- | --- |
| CIMultiDict `popitem()` | 1097.4 → −2.0 | 1172.1 → −3.0 |
| MultiDict `d[key] = v`, existing key ... (continued)

793 of 1586 branches covered (50.0%)

Branch coverage included in aggregate %.

9353 of 10217 relevant lines covered (91.54%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37441182416.1 06 Oct 2026 09:11AM UTC 98
85.96
GitHub Action Run
Source Files on build 37441182416
  • 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 #37441182416
  • 2db70d6b on github
  • Prev Build on master (#37438296245)
  • Next Build on master (#37445951547)
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