New VectorAPI benchmark to accelerate JsonParsing through fast table lookup using Vector.selectFrom API#105
Merged
ionutbalosin merged 2 commits intoionutbalosin:mainfrom Aug 5, 2025
Conversation
…lookup using Vector.selectFrom API
ionutbalosin
requested changes
Aug 3, 2025
| * - JEP 489: Vector API (Ninth Incubator): https://openjdk.org/jeps/489 | ||
| * - Parsing Gigabytes of JSON per Second : https://arxiv.org/abs/1902.08318 | ||
| */ | ||
| @BenchmarkMode(Mode.Throughput) |
Owner
There was a problem hiding this comment.
Could you please use @BenchmarkMode(Mode.AverageTime)?
The main reason is that after all the benchmarks run, I have some additional logic that calculates the geometric mean, which relies on AverageTime and keeps it consistent across all benchmarks.
Contributor
Author
There was a problem hiding this comment.
Done
Benchmark (size) Mode Cnt Score Error Units
FastJSONCodePointMatchBenchmark.match_avx2 1024 avgt 2 303.377 ns/op
FastJSONCodePointMatchBenchmark.match_avx512 1024 avgt 2 15.549 ns/op
FastJSONCodePointMatchBenchmark.match_scalar 1024 avgt 2 694.167 ns/op
ionutbalosin
approved these changes
Aug 3, 2025
chriswhocodes
approved these changes
Aug 5, 2025
Contributor
Author
|
Thanks @chriswhocodes and @ionutbalosin , kindly merge this PR. |
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.
Benchmark performs fast table lookup to match following JSON structural code points to accelerate JSON parsing scheme described in [1] using two vector selectFrom API[2] added in JDK-24[3]
, -> 0x2c
: -> 0x3a
[ -> 0x5b
] -> 0x5d
{ -> 0x7b
} -> 0x7d
tab, line feed, carriage return -> 0x9, 0xa, 0xd
space -> 0x20
Following are the perfromance numbers on Ryzen 7 7840HS - AVX512 system.
[1] Parsing Gigabytes of JSON per Second : https://arxiv.org/abs/1902.08318
[2] Vector.selectFrom
[3] JEP 489: Vector API (Ninth Incubator): https://openjdk.org/jeps/489