[Java Extension] Ported the C extension parser to the Java and remove ragel generated parser.#1004
Open
samyron wants to merge 1 commit into
Open
[Java Extension] Ported the C extension parser to the Java and remove ragel generated parser.#1004samyron wants to merge 1 commit into
samyron wants to merge 1 commit into
Conversation
Contributor
Author
|
Tagging @headius for a review on this PR. |
Contributor
Author
|
Additional thought: We should probably add additional JRuby versions to CI and include the Vector API system properties to ensure the |
Member
|
Is this the parser mentioned by @enebo in #983 (comment) or is it a concurrent effort? |
Contributor
Author
This is a concurrent effort. I missed that comment as I didn't refer back to that issue once #989 was opened. |
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.
Overview
This PR is a port of the current C extension parser to Java. It removes the ragel generated parser.
Implementation Notes
RubyHash#fastASetinstead ofRubyHash#op_asetas strings or symbols used as keys are explicitly frozen in this module. This contributed a significant performance boost to this Parser. The keys are frozen incachedKey/internedKeywhich is called viaparseStringwhenisName=true.ruby.json.useVectorizedParser=trueJVM property is set. If the Vector API is not available or explicitly disabled the SWAR implementation is used.rvalue_cachestyle cache as a quick cache for object keys. However, since the cache is heap allocated in Java, the size is 128 entries.Performance
These benchmarks were run on an M1 Macbook Air using jruby 10.0.5.0 and OpenJDK 64-Bit Server VM 24.0.1+9-30.
With the SWAR StringScanner
With the Vector API based StringScanner