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
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.
The current on-demand front-end, will, by default, use a slow parse_string (our function fro unescaping strings) that does not benefit from the processor's best instructions. We can make it available from the runtime dispatched kernels instead and possibly gain quite a bit of performance in some cases. This should not affect people who compile simdjson for their processor.
In PR #1847, I had exposed the parse_string function as a generic function, but in this new PR, it is tied to do the dom implementation, residing inside our parser instances. This new PR is less intrusive and should provide slightly better performance.
I have also added documentation as well as a new 'test' for parse.unescape, so that end users can benefit from it.
We do not have many benchmarks where strings are unescaped, but one of them (with short strings) is partial_tweets, and we do see small gains...
On icelake (AWS, GCC 11), I get...
Before... (two runs)
After... (two runs)