Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Msm Optimization
Hi there.
I optimized the best_multiexp algorithm and replaced it with a more efficient rayon method.
What I did
Task Size
Before
Current implementation divides task into coeffs length / thread number parts.
The more PC has process skill, the smaller the task size of each thread process.
It causes task size to be too heavy for small-core PCs and too small for large-core PCs.
After
Flatten task size to addition and sum of bucket for each segment.
Parallelization Scope
Before
The current implementation performs final sum with a non-parallel process.
After
Include the final sum to parallel scope.
Rayon Method
Before
$join =< par_iter =< scope$
According to official documentation, speed relation is as follows.
After
Replace
best_multiexp
scope withpar_iter
Other
Refactoring
Bucket
andget_at
.Benchmark
I ran best_multiexp benchmark twice
after -> before
andbefore -> after
in order to make machine condition same.First
Second
I would appreciate it if you could confirm.
Thank you.