herumi / bls-go-binary

22 stars 22 forks source link

About Issure: Using Multi Threads for Aggregating Signatures ... #4

Closed Coresummer closed 1 year ago

Coresummer commented 4 years ago

Add bls-go-binary/bls/bls.go/AggregateMT() function. By following execution time data on Raspberry pi4(4GB)
AggregateMT seems stably faster than regular Aggregate function.

Inputs (Number of Sign) Exec time of Aggregate() [us] Exec time of AggregateMT() [us] rate (Aggregate()/AggregateMT)
1000 2809.2 1713.4 1.63
10000 28107 15724 1.79
100000 280690 155180 1.81

Note: this function doesn't work faster than regular Appgregate() on high spec CPU like Corei7-10710U or Corei9-9900k Probably the reason why is because of the overhead of multi-threading is bigger than its benefit on such high clock cpu. Haven't try on Xeon(something 128 threads cpu), but I got a good feeling about that it might work also faster than the regular Aggregation function.

herumi commented 4 years ago

I've used OpenMP for aggregation. It seems faster. https://github.com/herumi/bls-go-binary/blob/Coresummer-dev/bls/bls_mt.go

herumi commented 4 years ago

But this code does not run on Mac (the OpenMP option is different).

herumi commented 4 years ago

I think that it is better to divide the given array into two or four parts and apply blsAggregateSignature. I'll try it if I have time.