Skip to content

[ty] Gate protocol compatibility on member count#24684

Merged
charliermarsh merged 1 commit intomainfrom
charlie/member-count
Apr 20, 2026
Merged

[ty] Gate protocol compatibility on member count#24684
charliermarsh merged 1 commit intomainfrom
charlie/member-count

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Apr 17, 2026

Summary

This is a small optimization in the manner of 93a16bd. Codex reports that for protocol with a large number of members (Small), and then another with one more member (Big), and def check_i(value: Small) -> Big: return value repeated many times, we get a 39% speedup.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Apr 17, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 17, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.36%. The number of fully passing files held steady at 79/133.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 17, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 17, 2026

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@charliermarsh charliermarsh added the performance Potential performance improvement label Apr 18, 2026
@charliermarsh charliermarsh marked this pull request as ready for review April 18, 2026 23:29
@carljm carljm removed their request for review April 19, 2026 04:12
Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

If this fixes a case where we previously had pathological (or much worse) performance, can we add that case as a microbenchmark in a separate PR and then rebase this PR on top of that to see the performance improvement in CI?

If we don't add benchmarks for this kind of thing and the improvement isn't reflected in codspeed or the ecosystem-analyzer timings, I think it'll be very easy for us to accidentally regress on performance in the future

@charliermarsh
Copy link
Copy Markdown
Member Author

Good call

@charliermarsh charliermarsh marked this pull request as draft April 19, 2026 17:24
@charliermarsh charliermarsh changed the base branch from main to charlie/member-benchmark April 19, 2026 19:15
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 19, 2026

Merging this PR will improve performance by 91.11%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 48 untouched benchmarks
⏩ 60 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation ty_micro[many_protocol_members_mismatch] 337 ms 176.4 ms +91.11%

Comparing charlie/member-count (0a460bb) with main (1ab0ba3)

Open in CodSpeed

Footnotes

  1. 60 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@charliermarsh charliermarsh marked this pull request as ready for review April 19, 2026 19:32
charliermarsh added a commit that referenced this pull request Apr 20, 2026
## Summary

Add a benchmark to demonstrate the improvement in
#24684.
Base automatically changed from charlie/member-benchmark to main April 20, 2026 01:52
@charliermarsh charliermarsh merged commit 7c597dc into main Apr 20, 2026
56 checks passed
@charliermarsh charliermarsh deleted the charlie/member-count branch April 20, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Potential performance improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants