perf(lexer): use portable-SIMD to speed up multiline comment scanning#23
Merged
perf(lexer): use portable-SIMD to speed up multiline comment scanning#23
Conversation
Contributor
Parser Benchmark Results |
strager
reviewed
Feb 23, 2023
Comment on lines
+150
to
+151
| let star_mask = any_star.to_bitmask(); | ||
| let slash_mask = any_slash.to_bitmask(); |
Contributor
There was a problem hiding this comment.
I have found that to_bitmask on ARM NEON can be cause parsing to be slower compared to a scalar version. My block comment parser only uses SIMD on x86, not ARM. Do you run your benchmarks on ARM NEON or just Intel SSE?
On x86_64, to_bitmask is one instruction. On AArch64, there is no instruction and to_bitmask needs to be emulated. See: https://godbolt.org/z/531oEo5d1 It looks like the Rust compiler currently does a terrible job on AArch64. You can definitely do better by hand, but it still might not be faster than the scalar version.
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.
No description provided.