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

Is there any way to optimize it? #50

Open
wenheyu opened this issue Sep 12, 2023 · 4 comments
Open

Is there any way to optimize it? #50

wenheyu opened this issue Sep 12, 2023 · 4 comments

Comments

@wenheyu
Copy link

wenheyu commented Sep 12, 2023

Hello, Daninet. I'm currently using this library in a Vue project and I want to calculate the SM3 hash of files in Chrome. However, I've noticed that the calculation speed is not very fast for large video files, especially those over 7GB. Is there any way to optimize it?

@Daninet
Copy link
Owner

Daninet commented Oct 15, 2023

The library should archive consistent speeds even with files larger than 7GB. The performance might be affected by disk I/O. SSD / HDD read speeds might be slower than the hashing.

@IVLIU
Copy link

IVLIU commented Jan 18, 2024

I used a PDF file of about 110MB for testing. js took about 400ms and wasm about 700ms. Is there a threshold and wasm is faster than js?

@Daninet
Copy link
Owner

Daninet commented Jan 18, 2024

According to my measurements the threshold is at a few kilobytes and in the other direction and when it's not warmed up. I mean JS might be faster with 1kb of data when the wasm binary is not optimized yet.
Do you have the chrome dev tools open? That has a large impact on WASM performance.

@IVLIU
Copy link

IVLIU commented Jan 19, 2024

According to my measurements the threshold is at a few kilobytes and in the other direction and when it's not warmed up. I mean JS might be faster with 1kb of data when the wasm binary is not optimized yet. Do you have the chrome dev tools open? That has a large impact on WASM performance.

Yes, I opened it, I need to retest

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

No branches or pull requests

3 participants