Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This branch has not been deployed
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.
Not yet ready for merge: needs re-measuring with more forks (results below are noisy) and review.
Applies the hot-loop lesson from #1775 / #1682 to
UTF8StreamJsonParser: C2 doesn't keep a field in a register across loop iterations, so a scan loop that advances_inputPtrdirectly stores it on every byte._parseFloat(): the fraction-digit loop now scans the current buffer with a local pointer (the outer loop still handles_loadMore()).parseLongName(): local pointer and local quad buffer;_inputPtris written back before each exit (parseEscapedName()continues from it)._parseUnsignedNumber()/_parseSignedNumber(): deliberately not changed, with a comment. With a local pointer C2 treats the integer loop as a counted loop and unrolls it: 13-digit longs got 10-17% faster, but typical 1-10 digit ints got 6-12% slower on JDK 25 (perfnorm: fewer instructions, but DSB->MITE shift and 2x branch misses; the gap reversed with-XX:LoopUnrollLimit=0).String value loops (
_finishString()etc.) already use local pointers.Results
ParseBench,nextToken()over a whole document: 2000 ints (1-10 digits), 2000 13-digit longs, 2000 doubles (123.4567891), and 100 objects with 40 property names of 16-40 bytes. i7-8550U/WSL2, 5 forks, us/op:Caveats:
3.xon JDK 25 ints scored 88-93 in four runs and 73 in one, with all forks agreeing within each run. The ints/longs docs run unchanged code (identical bytecode and inlining decisions, checked withPrintInlining), so they are left out of the table.parseLongName()change, so the size of that gain is uncertain. JDK 25 doubles was -14% in both runs.🤖 Generated with Claude Code