-
Notifications
You must be signed in to change notification settings - Fork 2
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 performance with derivePublicKey #6
Comments
I have now verified that running [email protected] with await nanocurrency.init() indeed result in 10,000 keys/s per thread compared to 300/s per thread with [email protected] which has no init() function. Easy to test with https://github.com/vitorcremonez/nano-vanity by doing npm install and jumping between the two versions. So something has changed with that library. Also tested with my own multithreading script and getting 70-120k per sec using 12 threads, with 1.7.4. |
First of all, thank you for your interest into this project! As I wanted to point to the underlying library responsible for the Nano related operations (marvinroger/nanocurrency-js) in ran into another issue you opend marvinroger/nanocurrency-js#75. A while back, the creator of the library switched most of the WebAssembly implementation to JavaScript due to maintainability marvinroger/nanocurrency-js#24. This is the reason why you're seeing such a big different between |
Ah, that makes sense, thanks for pointing to that issue! package.json
worker
|
I tried to get this library working with the latest NPM and react but I couldn't get it to work and ended up completely rebuilding it using react-app-rewired together with worker-loader instead of ejecting the whole project like you did.
It all works great with web workers, multithreading and all and the following code does the address creation and matching (it's taken from this codebase). However I have problem with performance. Without the derivePublicKey below I can do 150,000 loops per second. With the derivePublicKey the performance drops to 600/s. Another strange thing is that there is no difference using 2 threads or 12 when doing that. Just using "currentAddressesCount += 1" boost the loop count to 120 million per second so nothing wrong with the multithreading implementation. Using nanoaddr.io on the same machine gives 70,000 addresses per second so I know it should be possible to boost. I just don't understand what's wrong. Do you remember running into that issue? And how did you solve it? Any help you could give is greatly appreciated. You can reach me on discord in the Nano server as Json.
The new tool will be part of a complete set of web tools I'm building for Nano and I will reference this repo as a source.
The text was updated successfully, but these errors were encountered: