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

bulk add demo #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

bulk add demo #1

wants to merge 1 commit into from

Conversation

mratsim
Copy link
Owner

@mratsim mratsim commented Oct 23, 2022

Demo for devcon cc @asn-d6

Compiled with GCC
Optimization level => no optimization: false | release: true | danger: true
Running on 11th Gen Intel(R) Core(TM) i9-11980HK @ 2.60GHz


⚠️ Cycles measurements are approximate and use the CPU nominal clock: Turbo-Boost and overclocking will skew them.
i.e. a 20% overclock will be about 20% off (assuming no dynamic frequency scaling)

Backend: BLST, mode: 64-bit
====================================================================================================================================

Scalar multiplication G1 (255-bit, constant-time)                             10273.058 ops/s        97342 ns/op       321460 cycles
Scalar multiplication G2 (255-bit, constant-time)                              4501.341 ops/s       222156 ns/op       733647 cycles
EC add G1 (constant-time)                                                   1923076.923 ops/s          520 ns/op         1717 cycles
EC add G2 (constant-time)                                                    688231.246 ops/s         1453 ns/op         4798 cycles
EC bulk add G1 - 10                                                          244259.893 ops/s         4094 ns/op        13512 cycles
EC bulk add G2 - 10                                                           94348.523 ops/s        10599 ns/op        34992 cycles
EC bulk add G1 - 100                                                          29748.624 ops/s        33615 ns/op       111005 cycles
EC bulk add G2 - 100                                                          12546.579 ops/s        79703 ns/op       263202 cycles
EC bulk add G1 - 1000                                                          3880.797 ops/s       257679 ns/op       850947 cycles
EC bulk add G2 - 1000                                                          1464.804 ops/s       682685 ns/op      2254472 cycles
EC bulk add G1 - 1024                                                          3541.152 ops/s       282394 ns/op       932569 cycles
EC bulk add G2 - 1024                                                          1449.244 ops/s       690015 ns/op      2278671 cycles
EC bulk add G1 - 2048                                                          1906.930 ops/s       524403 ns/op      1731767 cycles
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

image

As mentioned, there is a crash in BLST currently if we go over 2048 G1 points or 1024 G2 points, unsure why but BLST batches addition 2048 by 2048 or 1024 by 1024 ( https://github.com/supranational/blst/blob/6382d67/src/bulk_addition.c#L148-L149 ) so the benchmark scales linearly to a million points

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