entropyxyz / crypto-primes

Random prime generation and primality testing library based on `crypto-bigint`.
https://docs.rs/crypto-primes
Apache License 2.0
17 stars 4 forks source link

Investigate the performance difference between `Uint` and `BoxedUint` #41

Open fjarri opened 6 months ago

fjarri commented 6 months ago

After #40, the safe 1024-bit prime generation benchmark for BoxedUint is about 30% slower than that for Uint. What are the contributing factors here?

One possible avenue for improvement would be making use of mutating methods to reduce the amount of allocations. This is especially prominent in lucas_test(), where we rely on clone() a lot, but may be useful in other places as well.