From 6f2ef2eacb927022e89b5e02edcbc8b06954639e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 22 Jan 2024 14:36:50 +0100 Subject: [PATCH] QDecompressHelper: update the benchmark After the zip bomb checks were added the benchmark was not adjusted. Also move the QByteArray creation outside the loop, to not include the time it takes to make a heap allocation. Pick-to: 6.7 6.5 Change-Id: Ia958d497dd27fc61e0084b6f5c11d76886bb24c4 Reviewed-by: Mate Barany Reviewed-by: Thiago Macieira --- tests/benchmarks/network/access/qdecompresshelper/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/benchmarks/network/access/qdecompresshelper/main.cpp b/tests/benchmarks/network/access/qdecompresshelper/main.cpp index 09c24af668f..7f8b09ef0e3 100644 --- a/tests/benchmarks/network/access/qdecompresshelper/main.cpp +++ b/tests/benchmarks/network/access/qdecompresshelper/main.cpp @@ -51,13 +51,14 @@ void tst_QDecompressHelper::decompress() file.seek(0); QDecompressHelper helper; helper.setEncoding(encoding); + helper.setDecompressedSafetyCheckThreshold(-1); QVERIFY(helper.isValid()); helper.feed(file.readAll()); qsizetype bytes = 0; + QByteArray out(64 * 1024, Qt::Uninitialized); while (helper.hasData()) { - QByteArray out(64 * 1024, Qt::Uninitialized); qsizetype bytesRead = helper.read(out.data(), out.size()); bytes += bytesRead; }