Skip to content

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

@unbalancedparentheses

Description

@unbalancedparentheses

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions