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

Competing implementation of RandomX in JavaScript. #306

Open
l1mey112 opened this issue Sep 25, 2024 · 4 comments
Open

Competing implementation of RandomX in JavaScript. #306

l1mey112 opened this issue Sep 25, 2024 · 4 comments

Comments

@l1mey112
Copy link

RandomX.js has been implemented and tested extensively against the ground truth. It reaches a hashrate of 20 H/s per thread, quite higher than the original proposed speed of 1-2 H/s, but still 5x slower than light verification on the same machine (100 H/s). Among 8-16 threads it reaches 150-200 H/s.

I suggest you take a look. This may pave way for feasible webminers, though I doubt it unless I can micro optimise it further or AES-NI instructions are added to WebAssembly SIMD.

@hyc
Copy link
Collaborator

hyc commented Sep 25, 2024

web mining was a cool idea but it'll never be as lucrative as ad placement, so webmasters have no reason to adopt it.

@SChernykh
Copy link
Collaborator

No AES, and no directed rounding means it will never be as fast as a native code. But only 5x difference is impressive. Also, web-mining can't use full mode (2 GB dataset), and that's another 10x slowdown.

Also,

All C++ code has been reimplemented or removed. C++ is a cancer that made the original library impossible to understand in one piece.

That's "I don't understand it therefore it's bad" attitude. C++ is a tool and it can be used in any way, including coding in C-style only. So it purely depends on the programmer, not the language itself to be "good or bad".

@hyc
Copy link
Collaborator

hyc commented Sep 25, 2024

Fwiw, the use of exceptions in the C++ library has been a persistent source of hassles. IMO writing the library in C++ was always a bad idea and I rewrote it in C myself as well to remove these issues.

@l1mey112
Copy link
Author

I have created an issue on the repository to track possible performance improvements in tiers of how meaningful they may be compared to development cost:

l1mey112/randomx.js#1

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