perf: bound long fractional parsing work - #26
Merged
Conversation
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.
Summary
FromStrparsing pathThese results compare
origin/mainat7df774fdirectly with the latest PR head ata3dde4d; they do not compare against an earlier PR commit. Values are the median of seven alternating local Divan runs per revision, with 500 samples of 4,096 iterations per run. The two new benchmark definitions were temporarily applied tomainso both revisions used identical inputs; lower is better.main(7df774f)a3dde4d)plaindecimal-unitbinary-unitfractionsmall-fractiongroupedu64-maxmalformedhigh-precision-decimalhigh-precision-binaryexcess-precision-decimalexcess-precision-binaryAcross the 10 pre-existing cases, the unweighted geometric-mean latency is 18.1% lower, while the sum of their medians is 7.5% lower. Neither aggregate is a production-workload average because the benchmark cases have no traffic weights.
A
mainplus inline-only control reproduced the ordinary-input improvements, so those gains come primarily from removing the cross-crate call boundary. The finite-prefix algorithm itself affects only inputs longer than 61 bytes; the existing high-precision inputs do not exercise that branch.Validated with
cargo x lint --fix,cargo x test, and the Rust 1.85 MSRV test suite.