Skip to content

Say which benchmark rows are not 200-item mappings - #1558

Merged
asvetlov merged 1 commit into
aio-libs:masterfrom
asvetlov:claude/benchmark-size-note
Sep 24, 2026
Merged

asvetlov merged 1 commit into
aio-libs:masterfrom
asvetlov:claude/benchmark-size-note

Conversation

@asvetlov

Copy link
Copy Markdown
Member

What do these changes do?

"What is measured" says every row uses a mapping of 200 keys, with
d.update(other) as the only exception. Since #1556 that is no longer
true: cls() builds an empty mapping and two rows use 20 items, so a
reader comparing them against the 200-key rows would draw the wrong
conclusion. This says which rows those are and why they differ.

Are there changes in behavior for the user?

No. Prose only; no measurement or table changes.

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

No.

Related issue number

Follows up #1556.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist — N/A, documentation only
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt — N/A, already listed
  • Add a new news fragment into the CHANGES/ folder
  • make doc-spelling passes and any new technical words are added to docs/spelling_wordlist.txt

Drafted with Claude Opus 5; reviewed by @asvetlov.

@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Sep 24, 2026
@asvetlov
asvetlov force-pushed the claude/benchmark-size-note branch from 6d10fb1 to b2013e9 Compare September 24, 2026 08:48
@codspeed

codspeed Bot commented Sep 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 310 untouched benchmarks


Comparing asvetlov:claude/benchmark-size-note (b2013e9) with master (ed928af)

Open in CodSpeed

@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1506c80) to head (b2013e9).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1558   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           41        41           
  Lines         7022      7074   +52     
  Branches       610       615    +5     
=========================================
+ Hits          7022      7074   +52     
Flag Coverage Δ
CI-GHA 100.00% <ø> (ø)
pytest 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asvetlov
asvetlov marked this pull request as ready for review September 24, 2026 09:14
@asvetlov
asvetlov requested a review from webknjaz as a code owner September 24, 2026 09:14
@asvetlov
asvetlov merged commit f28b2c0 into aio-libs:master Sep 24, 2026
62 checks passed
@asvetlov
asvetlov deleted the claude/benchmark-size-note branch September 24, 2026 09:17
@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The documentation concern does not block merging.

Reviews (1) · Last reviewed commit: "Say which benchmark rows are not 200-ite..."

Comment thread docs/benchmark.rst
Comment on lines +57 to +61
Three rows use a different size, because what they cost is dominated by an
allocation rather than by the entries: ``cls()`` builds an empty mapping, and
``cls(items)``, 20 items and ``d.copy()``, 20 items use a request's worth of
headers. An allocation is a fixed cost, so at 200 entries it is divided across
them and all but disappears; ``d.items()`` and ``iter(d)`` are listed for the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Entry costs are understated

The explanation describes the 20-item constructor and copy rows as dominated by fixed allocation costs. Yet the published dict instruction counts rise from 9,257 to 91,347 for construction and from 1,452 to 9,761 for copying at 200 items. Readers could mistake these rows for measurements of mostly fixed overhead rather than operations with substantial per-entry work. This wording is a non-blocking documentation concern.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Artifacts

Source of the published-value benchmark check

  • The authored check executes benchmark cases and compares the published instruction tables; it provides the reproducible verification command.

Benchmark check on the parent revision

  • The check ran against HEAD^ with exit code 0 and found the same instruction-count pattern before the claim was added.

Benchmark check on the revision containing the claim

  • The check ran against HEAD with exit code 0 and found entry-dependent instruction growth inconsistent with allocation dominance.

View artifacts

T-Rex Ran code and verified through T-Rex

@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.

  • P2 Allocation-dominance explanation conflicts with the published instruction counts ▶

    • Bug
      • Confirmed as misleading at docs/benchmark.rst:57-61. The 20-entry constructor and copy rows are not shown to be dominated by fixed allocation: their 200-entry counterparts cost substantially more, and the two-point fixed-cost estimate is below half of each 20-entry count. Empty construction has no entries, but does not establish the explanation for the other two rows.
    • Cause
      • The prose generalizes the fixed cost of allocation to operations that also process or copy entries.
    • Fix
      • Explain the smaller rows as representative small mappings without claiming their instruction cost is dominated by allocation; distinguish empty construction from construction and copying with entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant