nim-bncurve/bncurve.nimble
Jacek Sieka 1920adc42e
Reuse stint primitives for limbs
This PR makes bncurve less slow by reusing stint integer primtivies and
unrolling a few loops and arrays to avoid array length checks and the
like.

To give an idea, it brings down processing 8k nimbus-eth1 blocks around
the 18M block height mark from 24 to 16 minutes - this is quite
significant given that a lot of time in eth1 is spent reading the
database - this is at least an order of magnitude of bncurve improvement
but probably quite a lot more - how much doesn't greatly matter but now
there's at least a decent baseline for any future performance work ;)

Of course, reusing private primitives from `stint` is not pretty - the
plan is to extract them to a separate library, work started in
https://github.com/status-im/nim-stew/pull/187.
2024-08-08 16:29:06 +02:00

24 lines
639 B
Nim

packageName = "bncurve"
version = "1.0.1"
author = "Status Research & Development GmbH"
description = "Barreto-Naehrig pairing-friendly elliptic curve implementation"
license = "Apache License 2.0 or MIT"
skipDirs = @["tests", "Nim", "nim"]
### Dependencies
requires "nim >= 1.6.0",
"nimcrypto",
"stint"
task test, "Run all tests":
for tprog in @[
"tests/tarith",
"tests/tfields",
"tests/tgroups",
"tests/tpairing",
"tests/tether",
"tests/tvectors",
]:
exec "nim c -f -r -d:release --styleCheck:error --styleCheck:usages --threads:on " & tprog