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

Two times speed regression between 2.2.2 and 2.2.3 #123

Open
mahnunchik opened this issue Jul 17, 2023 · 3 comments · May be fixed by #124
Open

Two times speed regression between 2.2.2 and 2.2.3 #123

mahnunchik opened this issue Jul 17, 2023 · 3 comments · May be fixed by #124

Comments

@mahnunchik
Copy link

I've faced with the speed regression between version 2.2.2 and 2.2.3 for pointFromScalar method.

Simple test:

import * as secp256k1 from 'tiny-secp256k1';
import crypto from 'crypto';

const bufs = Array(10_000).fill(undefined).map(() => crypto.randomBytes(32));

for (const buf of bufs) {
  secp256k1.pointFromScalar(buf);
}
% time node tiny-222.js
node tiny-222.js  0,79s user 0,02s system 103% cpu 0,783 total
% time node tiny-223.js
node tiny-223.js  1,34s user 0,02s system 101% cpu 1,335 total

So at least pointFromScalar method became two times slower.

@junderw junderw linked a pull request Jul 18, 2023 that will close this issue
@junderw
Copy link
Member

junderw commented Jul 18, 2023

Testing locally, #124

2.2.2
tiny-secp256k1 (WASM): 99.09 us/op (10091.34 op/s), ±1.19 %

2.2.3
tiny-secp256k1 (WASM): 176.99 us/op (5649.99 op/s), ±1.03 %

remove lowmemory (#124)
tiny-secp256k1 (WASM): 94.00 us/op (10638.65 op/s), ±1.37 %

@junderw
Copy link
Member

junderw commented Jul 18, 2023

Please check if there are any other regressions you care about.

@mahnunchik
Copy link
Author

  • pointAddScalar method has less regression 1,28s -> 1,58s
  • pointMultiply it shows slightly better performance on 2.2.3 1,49s -> 1,44s

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

Successfully merging a pull request may close this issue.

2 participants