Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of digest64 #357

Open
twoeths opened this issue Mar 25, 2024 · 0 comments
Open

Improve performance of digest64 #357

twoeths opened this issue Mar 25, 2024 · 0 comments

Comments

@twoeths
Copy link
Contributor

twoeths commented Mar 25, 2024

Some improvement could be done:

  • Use latest assemblyscript yields better performance
  • Chain w computation to the main loop in hashBlocks()
  • Return result by using Uint8Array.slice()
digestTwoHashObjects vs digest64 vs digest
    ✓ digestTwoHashObjects 50023 times                                    19.25844 ops/s    51.92528 ms/op        -         67 runs   3.98 s
    ✓ digest64 50023 times                                                20.23583 ops/s    49.41730 ms/op        -         12 runs   1.11 s
    ✓ digest 50023 times                                                  20.31116 ops/s    49.23402 ms/op        -         13 runs   1.19 s

this branch

digestTwoHashObjects vs digest64 vs digest
    ✓ digestTwoHashObjects 50023 times                                    21.91978 ops/s    45.62089 ms/op        -       1304 runs   60.0 s
    ✓ digest64 50023 times                                                21.11148 ops/s    47.36759 ms/op        -       1256 runs   60.0 s
    ✓ digest 50023 times                                                  20.90464 ops/s    47.83628 ms/op        -       1244 runs   60.0 s

however benchmark result in CI consistently shows worse statistics so need to investigate this, may need to separate to smaller PRs in order to figure out the issue

Originally posted by @tuyennhv in #347 (comment)

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 a pull request may close this issue.

1 participant