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

aio-libs / multidict / 35965407040
87%

Build:
DEFAULT BRANCH: master
Ran 24 Sep 2026 06:38AM UTC
Jobs 1
Files 43
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

24 Sep 2026 06:37AM UTC coverage: 87.483%. Remained the same
35965407040

push

github

web-flow
Lay out the common branch in line in lookup and identity (#1550)

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

## What do these changes do?

Two branches on the hot path were being laid out with the frequent case
behind
a taken branch, so the common path jumped out of line and back.

The DKIX_DUMMY check in the four single-key lookup probe loops
(`_md_contains_locked`, `_md_contains_lockfree`, `_md_get_one_locked`,
`_md_get_one_lockfree`) now carries `UNLIKELY`. A dummy slot only
appears once
something has been deleted, so a pure lookup almost never walks over
one.

`_key_to_identity()` has its first test inverted so the exact-`str` case
is the
fallthrough. Left as written, GCC put that case out of line and gave the
straight line to `PyUnicode_FromObject()`, which only runs for a `str`
subclass.

The same `UNLIKELY` is deliberately **not** added to the probe loops of
the
deleting methods. Deleting is what creates dummy slots, so those loops
hit them
often; measured there it costs 0.85% on `__delitem__` and 0.5% on
`update()`.
Three other candidates were measured and rejected for the same reason:
the
resize check in `_md_add_with_hash_steal_refs()`, an `UNLIKELY` on the
`md_calc_identity_hash()` error return, and `ALWAYS_INLINE` on
`htkeys_get_index()`. Numbers for those are in the footer.

This is C only. The pure-Python backend has no equivalent notion of
branch
layout, so there is nothing to mirror there.

## Are there changes in behavior for the user?

No. Both hunks are pure code layout; the conditions tested and the
values
returned are unchanged.

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

No. It is five lines of annotation plus one inverted `if`.

## Related issue number

None.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist - N/A, no behavior change; the
existing suite covers both paths
- [x] Documentation reflects the changes - N/A
- [ ] If you provide code modification, pleas... (continued)

767 of 1534 branches covered (50.0%)

Branch coverage included in aggregate %.

7375 of 7773 relevant lines covered (94.88%)

1.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 35965407040.1 24 Sep 2026 06:38AM UTC 86
87.48
GitHub Action Run
Source Files on build 35965407040
  • Tree
  • List 43
  • 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 #35965407040
  • d3d93759 on github
  • Prev Build on master (#35965377150)
  • Next Build on master (#35966702630)
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