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

Checking Costantine library and copying some ideas and reference it #532

Closed
unbalancedparentheses opened this issue Aug 27, 2023 · 1 comment

Comments

@unbalancedparentheses
Copy link
Member

Comment by Constantine creator on how he made constantine library so fast:

  • Nim has better macro and compile-time evaluation capabilities so I implemented an assembly codegenerator in Nim macro.
  • Most Rust finite fields libraries return their result instead of in-place mutation. This is slow if the compiler doesn't manage to do return value optimization.
  • algorithm differences
  • Parallelization difference: I parallelize at 3 different levels of the MSM. Rust lib parallelize at only one-level. Also Rayon doesn't support futures and you can use it for significant latency hiding in bucket reductions.

The underlying parallel library in general is underestimated and I improve performance by up to 50% with just a better barrier algorithm here for CPU with 16+ cores: mratsim/constantine#227 (comment)

@MauroToscano
Copy link
Collaborator

I moved all the MSM related optimizations to issue #730

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

No branches or pull requests

2 participants