diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-03-22 08:59:36 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-03-31 10:32:45 +0100 |
commit | eb260c132a5e318be19bba82e2bd23cb72e67bfb (patch) | |
tree | 197c48b42abbafba0f8e626e2500424df8ca8331 | |
parent | 0eccfe5e390ca967f4c5cbc4093c9e50bbce9c33 (diff) |
tst_bench_QCryptographicHash: use resultView()
Don't benchmark the creation of the QByteArray from the internal
buffer, that's not interesting.
Call resultView() instead of result().
On the one hand, this skews comparisons with older benchmark data.
OTOH, result() used to be the fastest way to get the result out of
QCryptographicHash or QMessageAuthenticationCode, and now it's
resultView(), so in a way, it still is a fair comparison.
Pick-to: 6.5
Change-Id: I864b2f88f01e426c5d0967f57199e13dd7cb29f8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp index 2127298f59..8066650b32 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp +++ b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp @@ -117,7 +117,7 @@ void tst_QCryptographicHash::addData() hash.reset(); hash.addData(data); [[maybe_unused]] - auto r = hash.result(); + auto r = hash.resultView(); } } @@ -138,7 +138,7 @@ void tst_QCryptographicHash::addDataChunked() hash.addData({data.constData() + data.size() / 64 * 64, data.size() % 64}); [[maybe_unused]] - auto r = hash.result(); + auto r = hash.resultView(); } } @@ -178,7 +178,7 @@ void tst_QCryptographicHash::hmac_addData() mac.reset(); mac.addData(data); [[maybe_unused]] - auto r = mac.result(); + auto r = mac.resultView(); } } |