diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-04 15:38:59 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-04 15:44:56 +0000 |
commit | 5d7c2316045e416d0152dd5cd3a941be3843c67c (patch) | |
tree | b791b34f2887a2242acc2583bbdb83e699ea40b7 /tests/performance_tests | |
parent | Merge pull request #4676 (diff) | |
download | monero-5d7c2316045e416d0152dd5cd3a941be3843c67c.tar.xz |
rct: add a zeroCommit cache for common pre-rct case
This is called for every pre-rct output at blockchain sync time,
and a lot of them wil hit the cache, saving a scalarmult each.
Diffstat (limited to 'tests/performance_tests')
-rw-r--r-- | tests/performance_tests/crypto_ops.h | 4 | ||||
-rw-r--r-- | tests/performance_tests/main.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/performance_tests/crypto_ops.h b/tests/performance_tests/crypto_ops.h index 3c68583c5..25ab008db 100644 --- a/tests/performance_tests/crypto_ops.h +++ b/tests/performance_tests/crypto_ops.h @@ -40,6 +40,7 @@ enum test_op op_sc_mul, op_ge_add_raw, op_ge_add_p3_p3, + op_zeroCommitCached, ops_fast, op_addKeys, @@ -54,6 +55,7 @@ enum test_op op_addKeys3, op_addKeys3_2, op_isInMainSubgroup, + op_zeroCommitUncached, }; template<test_op op> @@ -108,6 +110,8 @@ public: case op_addKeys3: rct::addKeys3(key, scalar0, point0, scalar1, precomp1); break; case op_addKeys3_2: rct::addKeys3(key, scalar0, precomp0, scalar1, precomp1); break; case op_isInMainSubgroup: rct::isInMainSubgroup(point0); break; + case op_zeroCommitUncached: rct::zeroCommit(9001); break; + case op_zeroCommitCached: rct::zeroCommit(9000); break; default: return false; } return true; diff --git a/tests/performance_tests/main.cpp b/tests/performance_tests/main.cpp index 87a1573c2..3c71cb99f 100644 --- a/tests/performance_tests/main.cpp +++ b/tests/performance_tests/main.cpp @@ -256,6 +256,8 @@ int main(int argc, char** argv) TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_addKeys3); TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_addKeys3_2); TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_isInMainSubgroup); + TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_zeroCommitUncached); + TEST_PERFORMANCE1(filter, p, test_crypto_ops, op_zeroCommitCached); TEST_PERFORMANCE2(filter, p, test_multiexp, multiexp_bos_coster, 2); TEST_PERFORMANCE2(filter, p, test_multiexp, multiexp_bos_coster, 4); |