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

aio-libs / multidict / 36149088889
87%

Build:
DEFAULT BRANCH: master
Ran 25 Sep 2026 02:41PM 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

25 Sep 2026 02:40PM UTC coverage: 87.058%. Remained the same
36149088889

push

github

web-flow
Order MultiDictObject fields hot to cold and drop its module reference (#1584)

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

## What do these changes do?

Reorders the fields of the C extension's `MultiDictObject` from hot to
cold: the ones a lookup reads (`state`, `keys`, `num_active_readers` on
free-threaded builds, `is_ci`) come right after the object header, the
ones a mutation writes follow, and `retired` and the pre-3.12 `weaklist`
go last.

It also drops `MultiDictObject.mod`. Every multidict already reached the
same module through `state->mod`, so the object now owns its strong
reference to `state->mod` and releases it in dealloc and visits it in
traverse the same way. `state` stays addressable through teardown
exactly as before. `sizeof` drops from 72 to 64 bytes on the GIL build
and from 104 to 96 on the free-threaded one, which moves the allocation
into a smaller size class on both.

This only touches the C extension; the pure-Python implementation has no
equivalent layout.

## Are there changes in behavior for the user?

No. Each multidict uses 16 bytes less memory on 3.12+.

## 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, layout only, covered by the
existing suite
- [x] Documentation reflects the changes
- [ ] 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>

Measured on CPython 3.14.7 and 3.14.7t, x86-64.

Callgrind driver (`--include-multidict-only`), Ir per op, every other
row within 0.5%:

| operation | build | before | after |
|---|---|---|---|
| `ctor_empty... (continued)

780 of 1560 branches covered (50.0%)

Branch coverage included in aggregate %.

8086 of 8624 relevant lines covered (93.76%)

1.88 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36149088889.1 25 Sep 2026 02:41PM UTC 86
87.06
GitHub Action Run
Source Files on build 36149088889
  • 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 #36149088889
  • 89251238 on github
  • Prev Build on master (#36147951162)
  • Next Build on master (#36150297821)
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