Skip to content

QCOMPARE/QVERIFY: fix huge pessimisation in QTestResult

Albert Astals Cid requested to merge aacid/qtbase:faster_tests into kde/5.15

The old code allocated a stack buffer, but asked the runtime to zero-initialize it. That's 1KiB of writes to the stack on every QCOMPARE and QVERIFY before any actual work is done. Fixing this little laissez-faire to just initialize the first character in the buffer results in nice little speedups of up to or exceeding 2x.

Amends d9465077.

[ChangeLog][QtTestLib] Optimized successful QCOMPARE and QVERIFY for an up to 2x speedup.

This has the potential to meaningfully reduce the load on the CI, so picking all the way to 5.15.

Pick-to: 6.3 6.2 5.15 Change-Id: Ib93d69282ec87cbd26a60e4ac14413e8cef8ff78 Reviewed-by: Tor Arne Vestbø tor.arne.vestbo@qt.io Reviewed-by: Thiago Macieira thiago.macieira@intel.com Reviewed-by: Mårten Nordheim marten.nordheim@qt.io Reviewed-by: Edward Welbourne edward.welbourne@qt.io (cherry picked from commit 474792a7)

Merge request reports