Use simdutf for faster string encoding/decoding#976
Open
wh201906 wants to merge 11 commits intomargelo:mainfrom
Open
Use simdutf for faster string encoding/decoding#976wh201906 wants to merge 11 commits intomargelo:mainfrom
wh201906 wants to merge 11 commits intomargelo:mainfrom
Conversation
simdutf.cpp: From https://github.com/simdutf/simdutf/releases/download/v8.2.0/simdutf.cpp simdutf.h: From https://github.com/simdutf/simdutf/releases/download/v8.2.0/simdutf.h LICENSE-MIT: From https://raw.githubusercontent.com/simdutf/simdutf/v8.2.0/LICENSE-MIT
Specify simdutf::base64_default in encodeBase64() explicitly
simdutf supports hybird decoding format
Alighed with Buffer.from() behavior in Node
Author
|
There are some ongoing optimizations in simdutf, which can also be utilized in RNQC once implemented. |
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.
This PR migrates some string encoding/decoding functions in HybridUtils from OpenSSL/manual implementations to
simdutf:simdutfv8.2.0simdutffor base64/base64url encoding and decodingsimdutfforencodeLatin1()Buffer.from()in Node.jsThese changes significantly improve performance when encoding/decoding large base64 payloads. I ran the benchmark on an old Android device and here are the results:
(I added some test cases with 1kB data, but this PR doesn't include them)
base64 1MB encode throughput compared with CraftzdogBuffer: From 4.92x to 9.16x
base64 1MB decode throughput compared with CraftzdogBuffer: From 169.07x to 398.76x