bitcoin-core / secp256k1

Optimized C library for EC operations on curve secp256k1
MIT License
2.08k stars 1.01k forks source link

Recalibrate unit tests #1036

Open sipa opened 2 years ago

sipa commented 2 years ago

The tests (src/tests.cpp and included modules) consist of some tests whose runtime is independent of the TEST_ITERS variable, and some which are. The ones that are independent take a significant amount of time (compared to the other ones, at a normal TEST_ITERS level). The ones that do depend on it do so in a rather inconsistent way.

So to improve upon that:

real-or-random commented 2 years ago

gprof of ./tests 1 shows that the new test_ecmult_constants() tests is indeed very heavy.

gprof-tests1.txt

real-or-random commented 2 years ago

Related comment introduced in https://github.com/bitcoin-core/secp256k1/pull/1122/commits/17065f48ae261c6949dab74a7c197ac13b52eb1b:

https://github.com/bitcoin-core/secp256k1/blob/3efeb9da21368c02cad58435b2ccdf6eb4b359c3/src/tests.c#L7091-L7093