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

Highly variable performance #8

Open
dcousens opened this issue Jan 30, 2018 · 1 comment
Open

Highly variable performance #8

dcousens opened this issue Jan 30, 2018 · 1 comment

Comments

@dcousens
Copy link
Contributor

dcousens commented Jan 30, 2018

let scrypt = require('scryptsy')
let passphrase = Buffer.from('54657374696e674f6e6554776f5468726565', 'hex')
let salt = Buffer.from('e957a24a', 'hex')

function time (f) {
  let t0 = new Date().getTime()
  f()
  console.log((new Date().getTime() - t0) + ' ms')
}

time(() => scrypt(passphrase, salt, 16384, 8, 8, 64))
time(() => scrypt(passphrase, salt, 16384, 8, 8, 64))
3058 ms
16034 ms

Results are consistently 5x on the second call.
Related bitcoinjs/bip38#40 (comment)

@sondreb
Copy link

sondreb commented Feb 15, 2019

Any progress on this? I'm using BIP38 lib and these are the timings:

2461ms taken to decrypt
11303ms taken to decrypt.
11257ms taken to decrypt.

Appears to run fairly fast the first time, but all subsequent calls takes a lot of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants