Benchmark the input shapes callers actually supply - #381
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #381 +/- ##
=======================================
Coverage 98.01% 98.01%
=======================================
Files 39 39
Lines 52818 52818
Branches 1105 1105
=======================================
Hits 51770 51770
Misses 795 795
Partials 253 253 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
📊 Benchmark Results
PR branch
PR base
|
This was referenced Aug 14, 2026
Closed
Closed
This was referenced Aug 23, 2026
Closed
Closed
This was referenced Aug 31, 2026
Closed
Closed
This was referenced Sep 1, 2026
Closed
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An allocation probe over
Parseshowed the seed data is the cheapest input the library can be handed:+16502530000(E164 — what the benchmark uses)6502530000national, no prefix020 7031 3000national with prefix+1 650 253 0000 ext. 123with extensionPhoneNumberBenchmarkDataformats everything to E164, where the national-prefix and extension regexesboth fail — and a failed match returns the shared
Match.Emptyfor free. A successful one allocatesthe
Match, aGroupCollectionand aGroupper group. So the two things that dominate a real parsenever run in the benchmark, and any fix for them would measure as zero.
Adds
ParseNationalFormatandParseWithExtension, re-rendering the same numbers viaFormat.Separate benchmarks rather than mixing them into
ParseOnly: blending would give one number thatcan't attribute anything, and
ParseOnlystays comparable to the figure tracked across earlier PRs.Costs two benchmark cases (~45s per tree). Lands before the optimisation so the base commit has a
counterpart to compare against.