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.
Adds SIMD acceleration via libbase64.
Depends on the yet-to-be-released haskell bindings library, libbase64-bindings.
Adds a cabal flag,
simd
, to enable SIMD. Enabled by default.Benchmarks
I'm running this on a relatively quiet box, with NixOS/Linux installed.
CPU Info of the machine where I'm running these benchmarks:
If you download the current criterion benchmark reports you can view them in your browser.
For small ByteStrings, there is a significant penalty, so we should probably guard which encoding method is done based on the size of the ByteString. (EDIT: From experiments I determined that 1000 bytes is a safe threshold for encoding fallback, and 250 bytes for decoding. This PR implements the thresholds for
encodeBase64_
anddecodeBase64_
, currently.)Speedup summary tables (does not include unaffected under-threshold ByteStrings)
encodeBase64_
Speedups:base64
base64-bytestring
decodeBase64_
Speedups:base64
base64-bytestring