Skip to content

Experimental SIMD for BLAKE-3 and SHA-256#80

Open
TheUltDev wants to merge 1 commit into
Daninet:masterfrom
TheUltDev:simd
Open

Experimental SIMD for BLAKE-3 and SHA-256#80
TheUltDev wants to merge 1 commit into
Daninet:masterfrom
TheUltDev:simd

Conversation

@TheUltDev

Copy link
Copy Markdown

I've implemented SIMD for BLAKE-3 and SHA-256. You will see modest gains with SHA-256, but massive gains with BLAKE-3.
Note that MAX_HEAP was increased from 16 to 64kb. This was needed to take advantage of BLAKE-3 SIMD. Otherwise you will only get a slight speedup.

You can try it out by replacing hash-wasm with @ult/hash-wasm or trying my benchmark tool (source).

image

@TheUltDev

Copy link
Copy Markdown
Author

Note that we now have two WASM files embedded for SIMD-enabled algos.
This is not ideal, but neither is base64 encoding them as it currently does.

Personally I think the WASM files should be loaded dynamically, but that is an api change and is more prone to errors unless you set it up properly. I won't dictate that for this project, it's out of scope of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant