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

Benchmarks are slowed down when other modules are imported #91

Open
paulmillr opened this issue Jul 1, 2024 · 0 comments
Open

Benchmarks are slowed down when other modules are imported #91

paulmillr opened this issue Jul 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@paulmillr
Copy link
Owner

paulmillr commented Jul 1, 2024

I've spotted this after benchmarks were transitioned from common.js to ESM in 88c1aa3. Check out main branch.

  • git clone [email protected]:paulmillr/noble-hashes.git && cd noble-hashes && npm install && npm run build && npm run bench:install
  • Comment-out lines 14-28 in benchmark/hashes.js, run again. sha3 would become 25% faster

We need to investigate:

  1. Why sha3 is 25% slower when other modules are imported
  2. Why sha2 is NOT slower when other modules are imported. What's special about sha3?
  3. Why everything was fine with common.js, but is slow with ESM?
  4. Bonus issue: re-exporting isBytes slows-down performance considerably. See branch https://github.com/paulmillr/noble-hashes/tree/import-perf. Probably related.

To investigate this, v8/node.js profiling, memory dumps, etc may help.

@paulmillr paulmillr added the bug Something isn't working label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant