dchest / scrypt-async-js

Fast "async" scrypt implementation in JavaScript

Home Page:http://dchest.github.io/scrypt-async-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimize scrypt performance working over multiple cores with multiple web workers

fpietrosanti opened this issue · comments

Hi,

is it possible, after having estimated the numbers of CPU cores of a browser (using https://github.com/oftn/core-estimator), to use scrypt-async-js in a way that will split it's CPU load across multiple webworkers (so, multiple CPU cores) ?

Is the algorithm logic supporting somehow this optimization / implementation?

Hi,

There is no way to split computation into multiple cores as it is (that's one of the points of scrypt), but there's a parallelization parameter (p) in the original algorithm, which enables something like this, however it's not usually used (even reference implementation computes it sequentially), and scrypt-async-js doesn't support it for simplicity (p is fixed to 1).