diff --git a/tests/performance_tests/check_hash.h b/tests/performance_tests/check_hash.h index d786cc36a..caa091586 100644 --- a/tests/performance_tests/check_hash.h +++ b/tests/performance_tests/check_hash.h @@ -32,11 +32,12 @@ #include "int-util.h" #include "cryptonote_basic/difficulty.h" -template +template class test_check_hash { public: - static const size_t loop_count = 100000; + static const size_t loop_count = 2; + static const size_t inner_loop_count = 300000; bool init() { @@ -62,7 +63,17 @@ public: bool test() { - cryptonote::check_hash_128(hash, difficulty); + for (size_t j = 0; j < inner_loop_count; ++j) + { + if constexpr (FORCE_128) + { + cryptonote::check_hash_128(hash, difficulty); + } + else + { + cryptonote::check_hash(hash, difficulty); + } + } return true; } diff --git a/tests/performance_tests/main.cpp b/tests/performance_tests/main.cpp index 9cae5df1f..ea24bf02e 100644 --- a/tests/performance_tests/main.cpp +++ b/tests/performance_tests/main.cpp @@ -188,13 +188,20 @@ int main(int argc, char** argv) TEST_PERFORMANCE4(filter, p, test_check_tx_signature_aggregated_bulletproofs, 2, 2, 56, 16); TEST_PERFORMANCE4(filter, p, test_check_tx_signature_aggregated_bulletproofs, 10, 2, 56, 16); - TEST_PERFORMANCE4(filter, p, test_check_hash, 0, 1, 0, 1); - TEST_PERFORMANCE4(filter, p, test_check_hash, 0, 0xffffffffffffffff, 0, 0xffffffffffffffff); - TEST_PERFORMANCE4(filter, p, test_check_hash, 0, 0xffffffffffffffff, 0, 1); - TEST_PERFORMANCE4(filter, p, test_check_hash, 1, 0, 1, 0); - TEST_PERFORMANCE4(filter, p, test_check_hash, 1, 0, 0, 1); - TEST_PERFORMANCE4(filter, p, test_check_hash, 0xffffffffffffffff, 0xffffffffffffffff, 0, 1); - TEST_PERFORMANCE4(filter, p, test_check_hash, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0, 1, 0, 1, true); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0, 0xffffffffffffffff, 0, 0xffffffffffffffff, true); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0, 0xffffffffffffffff, 0, 1, true); + TEST_PERFORMANCE5(filter, p, test_check_hash, 1, 0, 1, 0, true); + TEST_PERFORMANCE5(filter, p, test_check_hash, 1, 0, 0, 1, true); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0xffffffffffffffff, 0xffffffffffffffff, 0, 1, true); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, true); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0, 1, 0, 1, false); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0, 0xffffffffffffffff, 0, 0xffffffffffffffff, false); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0, 0xffffffffffffffff, 0, 1, false); + TEST_PERFORMANCE5(filter, p, test_check_hash, 1, 0, 1, 0, false); + TEST_PERFORMANCE5(filter, p, test_check_hash, 1, 0, 0, 1, false); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0xffffffffffffffff, 0xffffffffffffffff, 0, 1, false); + TEST_PERFORMANCE5(filter, p, test_check_hash, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, false); TEST_PERFORMANCE0(filter, p, test_is_out_to_acc); TEST_PERFORMANCE0(filter, p, test_is_out_to_acc_precomp);