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

Parallelize aggregation of BLS signatures #14

Open
jules opened this issue Aug 21, 2019 · 2 comments
Open

Parallelize aggregation of BLS signatures #14

jules opened this issue Aug 21, 2019 · 2 comments
Assignees
Labels
BLS Issue related to BLS signature performance

Comments

@jules
Copy link
Contributor

jules commented Aug 21, 2019

The BLS package currently only allows for the aggregation of two signatures at a time - leaving any caller to loop through any array of signatures, and having to do it sequentially. Parallelizing this would save callers a lot of time.

@jules jules added BLS Issue related to BLS signature performance labels Aug 21, 2019
@autholykos autholykos self-assigned this Aug 22, 2019
@autholykos
Copy link
Member

autholykos commented Aug 24, 2019

Following are a first benchmark of naive parallelization with 2/4/8/12 go routines.
TL;DR best setup seems to be run 4 workers that operates the gfP.Add operations concurrently.

HW specs

16GiB System Memory
256KiB L1 cache
1MiB L2 cache
8MiB L3 cache
Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz

Sequential signature aggregation

Variance over 10 runs: 44.9µs ± 0%

BenchmarkAggregate100Signatures-8          30000             45001 ns/op               0 B/op          0 allocs/op

Concurrent Signature aggregation with 2 workers

Compared to sequential, delta: -23.60%
Variance over 10 runs: 38.9µs ± 3%

BenchmarkAggregate100Signatures-8          50000             34382 ns/op              64 B/op          3 allocs/op

Concurrent Signature aggregation with 4 workers

Compared to sequential, delta: -32.5%
Variance over 10 runs: 31.2µs ± 2%

BenchmarkAggregate100Signatures-8          50000             30667 ns/op              80 B/op          3 all

Concurrent Signature aggregation with 8 workers

Compared to sequential, delta: -13.15%
Variance over 10 runs: 38.1µs ± 1%

BenchmarkAggregate100Signatures-8          50000             39082 ns/op             240 B/op          4 allocs/op

Concurrent Signature Aggregation with 12 workers

Compared to sequential, delta: -9.07%
Variance over 10 runs: 41.5µs ± 1%

BenchmarkAggregate100Signatures-8          30000             40919 ns/op             336 B/op          4 allocs/op

@autholykos
Copy link
Member

autholykos commented Aug 24, 2019

The benchmarks show a significant improvement in performances (over 30% speedup) by introducing a light parallelization of bls Signature aggregation. However, it would be preferrable goroutine-based optimization to be operated within the user of the library to not impose any scheduling side effect on the usage of the BLS library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLS Issue related to BLS signature performance
Projects
None yet
Development

No branches or pull requests

2 participants