-
Notifications
You must be signed in to change notification settings - Fork 30
Optimize Utf8Validator with constant input Vector.slice API #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jatin-bhateja
wants to merge
1
commit into
simdjson:main
Choose a base branch
from
jatin-bhateja:utf8_validator_slice_opt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Optimize Utf8Validator with constant input Vector.slice API #68
jatin-bhateja
wants to merge
1
commit into
simdjson:main
from
jatin-bhateja:utf8_validator_slice_opt
+28
−55
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
Quick notes on Utf8Validation implementation :-
|
Here is the PoC implimentation for optimizing existing Utf8Validator with two lookup table over existing three lookup table solution. |
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.
Patch replaces existing bulky handling for pulling in the last, second last, and third last byte of the previous byte vector chunk in Utf8Validator with an optimized constant input Vector.slice API.
The following are the results of the performance analysis of Utf8ValidatorBenchmark on an AMD Ryzen 7 7840HS 8C 16T AVX512 system.
Analysis:-
Utf8Validator with slice API is performant on AVX512 targets even without ALIGNR-based instruction sequence.
But, on AVX2/Intel E-core targets only ALIGNR-based slice optimization part of JDK mainline PR[1] is performant.
On AMD targets, where both client and server support AVX512 ISA, the slice-based Utf8Validator will always
be performant even with stock JDK-24.0.2.
While on Intel targets, we need to wait till integration of PR[1] and also gradle compatibility with JDK-25+,
JDK-8290322 improved the byte vector rearrange on AVX2/E-core targets, but its performance does not
match up to the direct VPERMB instruction.
PS: Patch depends on integration of existing simd-json PR[2]
[1] openjdk/jdk#24104
[2] #67