-
Notifications
You must be signed in to change notification settings - Fork 162
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
MultiExp bench seems a bit "optimistic" #205
Comments
No the MSM is not doing a ton of dbl; the You can try for your self the benchmarks with randomizing the points, I doubt the result will vary. (it doesn't on my machine for the reference 2 >> 20 size). edit: not randomizing may indeed trigger more doubling, for the first operation on each bucket index. So ~80ns * len(buckets) (* time chunks) delta, which may bias the result within a ~2% margin (eye balling) for 1 << 20 and c= 16 |
I did try, with random points it's almost 50%-2x slower on my mac. I run both your parallel code and a "single thread" version of the same algo. When you add to the buckets:
I couldn't test on amd yet, maybe the bias is only 2% like you say, but I just thought it'd might be more fair to just use random points. |
You're right, I stand corrected :-). On mac (arm) the difference is ~40%, on x86 ~33%, definitely worth it to correct that and not measure a best case scenario. Thanks for raising the issue 👍 |
🙌 |
See this line:
https://github.com/ConsenSys/gnark-crypto/blob/master/ecc/bls12-377/multiexp_test.go#L209
All points are equal, so the MSM algo is doing a ton of dbl that in ExtJac are considerably faster than add.
As a result the numbers one gets running
go test -bench
are extremely optimistic.I'd recommend generating a somewhat random set of points.
The text was updated successfully, but these errors were encountered: