nim-lang / bigints

BigInts for Nim
MIT License
124 stars 32 forks source link

Benchmarks #113

Open dlesnoff opened 2 years ago

dlesnoff commented 2 years ago

I benchmarked multiplication, division, random generation of bigints. Without flags, the operations are slow, with flags, the timings looks correct to me. The code source quality of benchBigints.nim can be improved with templates to do less copy-paste in the future. I have also changed some of the examples to import them (by exporting some procedures and using whenIsmainmodule) so that I can benchmark them. I added some corresponding nimble tasks. I use -d:lto -d:danger --opt:speed flags for benchmarks. I consider using benchy for benchmarks is ok, it does not make it a dependency of the full library, it is only required for benchmarks. This PR might be really useful for easy comparison of our changes to the library.

pietroppeter commented 2 years ago

in the past I did some benchmarking (addition and multiplication, inspired by a Js benchmarking suite) during a PR (then removed the code). They were done using library criterion and published results in a generated md file. Maybe it can turn out useful for this PR: https://github.com/nim-lang/bigints/pull/35#issuecomment-733159960