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

aio-libs / multidict / 37731490339
86%

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

08 Oct 2026 05:15AM UTC coverage: 85.961%. Remained the same
37731490339

push

github

web-flow
Rewrite the view set ops' table loops on top of md_walk_all() (#1743)

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

## What do these changes do?

Rewrites the last two hand-written table loops in `views.h` on top of
`md_walk_all()`: the one behind `other | items` and `items - other`
(`_itemsview_unmatched()`) and the one behind `other | keys`
(`_keysview_or_rht()`). Each loop body becomes a visitor; both share a
small state struct. The walk's own version check replaces the per-loop
one.

The other view operations already go through `md_walk()` or
`md_contains()`.

Callgrind, 100 entries, instructions per operation on 3.14.7 (mean of
MultiDict and CIMultiDict):

| op | GIL before | GIL after | FT before | FT after |
|---|---|---|---|---|
| `set() \| keys()` | 48,462 | 47,982 (-1.0%) | 61,207 | 64,194 (+4.9%)
|
| `set() \| items()` | 129,906 | 128,564 (-1.0%) | 145,373 | 145,230
(-0.1%) |
| `items() - set()` | 127,464 | 125,752 (-1.3%) | 142,482 | 142,755
(+0.2%) |

The FT cost on the keys path comes from the walk taking a reference to
each value, which the old loop never touched. All of these operations
are `COLD`.

The pure-Python backend is unaffected.

## Are there changes in behavior for the user?

No.

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

No; it removes about 30 lines of duplicated table walking.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist (existing view and
`test_scan_raises_when_resized_by_an_entry` tests)
- [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`

<details>
<summary>Agent run details (optional, for reviewers)</summary>

Tests: `pytest -q` on 3.14.7 (4089 passed) and 3.14.7t (4074 passed);
`... (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 - 37731490339.1 08 Oct 2026 05:16AM UTC 98
85.96
GitHub Action Run
Source Files on build 37731490339
  • 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 #37731490339
  • 78399e8d on github
  • Prev Build on master (#37673564418)
  • Next Build on master (#37732114291)
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