β‘ Bolt: 10x faster version comparison #813
Closed
+64
β16
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.
π‘ What: Replaced regex and split-based version parsing with a manual, allocation-free parser in
compareTo.π― Why: Version comparisons are a hot path. The previous implementation allocated strings and arrays for every check.
π Impact:
isAtLeastand related methods (5.45Β΅s -> 0.50Β΅s).π¬ Measurement: Verified with
mitatabenchmark and existing test suite.PR created automatically by Jules for task 861562793865088442 started by @srod
Summary by cubic
Replaced regex/split-based version parsing in compareTo with a manual, allocation-free parser. Version checks (isAtLeast and related) are ~10x faster (5.45Β΅s β 0.50Β΅s) with near-zero allocations, while preserving all previous edge-case behavior.
Written for commit 2bbcd7b. Summary will update on new commits.