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

aio-libs / multidict / 38357421796
86%

Build:
DEFAULT BRANCH: master
Ran 13 Oct 2026 06:50AM UTC
Jobs 1
Files 50
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

13 Oct 2026 06:33AM UTC coverage: 85.863%. Remained the same
38357421796

push

github

web-flow
Mark the exception paths in the C extension as unlikely (#1791)

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

## What do these changes do?

Wraps the C extension checks whose taken branch means a Python exception
is set in `UNLIKELY()`, including the `hash == -1` checks after
`unicode_hash()`. Checks where `NULL` or `-1` means "not found" or "take
the fallback path" stay as they are.

Some error checks stay unmarked on purpose. GCC sits at its inlining
budget, and marking them changed which helpers it inlines on the add,
update, iteration and istr paths, even though each mark is harmless on
its own:

- `_multidict.c`: inlines `md_add` into `add()` on FT, not measured yet.
- `bulk_update.h:156`, `:531`, `:535` (the `hash == -1` in
`_md_extend_item()`), `:538`, and the `capsule.h` type check macro: on
FT, `md_add_with_hash_steal_refs`, `_md_update_matched` and
`_md_set_default_locked` move out of line, which made the constructor
7.5% slower and `update()` 10.7% slower.
- `bulk_update.h:181`: FT `CIMultiDict.update()` +2.2%.
- `bulk_update.h:482`: together with the `extend` sites, it takes
`_md_update_key()` out of line in `_multidict_bulk_locked()`, making GIL
`update()` 4% slower.
- `iter.h:311`: together with `:317`, `for k in d` costs one extra
instruction per key.
- `istr.h:48`: CIMultiDict `popitem()` costs 12 extra instructions.

## Are there changes in behavior for the user?

No.

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

No. New error checks can follow the same pattern, but a mark on a hot
path should be measured, since it can shift inlining elsewhere.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [ ] Unit tests for the changes exist: N/A, no behaviour change; the
existing suite covers these paths
- [ ] 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/` folde... (continued)

842 of 1684 branches covered (50.0%)

Branch coverage included in aggregate %.

9799 of 10709 relevant lines covered (91.5%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 38357421796.1 13 Oct 2026 06:50AM UTC 100
85.86
GitHub Action Run
Source Files on build 38357421796
  • Tree
  • List 50
  • 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 #38357421796
  • 6b62c220 on github
  • Prev Build on master (#38356582173)
  • Next Build on master (#38391036861)
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