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

Slow Sha512 Performance on JS #1206

Open
luca992 opened this issue Jan 17, 2023 · 3 comments
Open

Slow Sha512 Performance on JS #1206

luca992 opened this issue Jan 17, 2023 · 3 comments
Labels

Comments

@luca992
Copy link

luca992 commented Jan 17, 2023

Sha512 performance is very slow on JS due to it using Long numbers.

JS does not have 64-bit integers, so Kotlin/JS has to emulate them. Which causes so much overhead on JS that when I run Sha512 on my web app it causes my entire web app to freeze for a few seconds:
Screenshot 2023-01-16 at 8 16 28 PM

If possible, could Sha512 be ported to use Double for the JS target? Which are much much faster

@swankjesse swankjesse added the bug label Jan 29, 2023
@swankjesse
Copy link
Member

Oooooh yeah that’s not great. We should look at JS-language implementations of SHA256 and see what types they’re using.

@Lisi-Chen
Copy link

Hi @luca992 and @swankjesse,

I've observed the performance challenges with Sha512 in JS, particularly around the emulation of 64-bit integers. I'm keen to dive deeper and work on alternatives like leveraging Double for the JS target or referencing best practices from existing JS SHA256 implementations.

Could I be assigned to this issue?

Thanks,
Lisi

@swankjesse
Copy link
Member

We’re not actively seeking new contributors to this project at the moment. If you’d like to offer advice or code, please do! But I don’t want to promisee that we’re going to accept your work when you’re done.

luca992 added a commit to luca992/kotlin-bip39 that referenced this issue Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants