Skip to content

KStandardAction: use `QUtf8StringView` to view untranslated text

Fushan Wen requested to merge work/fuf/reduce into master

It's logically correct, and faster.

Benchmark: https://invent.kde.org/-/snippets/3120

********* Start testing of SpeedTest *********
Config: Using QtTest library 6.7.0, Qt 6.7.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 13.2.1 20240206 [revision 67ac78caf31f7cb3202177e6428a46d829b70f23]), opensuse-tumbleweed 20240428
QCRITICAL: SpeedTest::initTestCase() "%1"
PASS   : SpeedTest::initTestCase()
PASS   : SpeedTest::test_bytearray()
RESULT : SpeedTest::test_bytearray():
     8,609 nsecs per iteration (total: 8,609, iterations: 1)
     1,307 CPU cycles per iteration, 152 MHz (total: 1,307, iterations: 1)
     1,171 instructions per iteration, 0.896 instr/cycle (total: 1,171, iterations: 1)
     255 branch instructions per iteration, 29.6 M/sec (total: 255, iterations: 1)
PASS   : SpeedTest::test_ranges_utf8view()
RESULT : SpeedTest::test_ranges_utf8view():
     10,882 nsecs per iteration (total: 10,882, iterations: 1)
     718 CPU cycles per iteration, 66 MHz (total: 718, iterations: 1)
     977 instructions per iteration, 1.361 instr/cycle (total: 977, iterations: 1)
     230 branch instructions per iteration, 21.1 M/sec (total: 230, iterations: 1)
PASS   : SpeedTest::test_ranges_bytearrayview()
RESULT : SpeedTest::test_ranges_bytearrayview():
     6,965 nsecs per iteration (total: 6,965, iterations: 1)
     655 CPU cycles per iteration, 94 MHz (total: 655, iterations: 1)
     977 instructions per iteration, 1.492 instr/cycle (total: 977, iterations: 1)
     230 branch instructions per iteration, 33 M/sec (total: 230, iterations: 1)
PASS   : SpeedTest::cleanupTestCase()
Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 73ms
********* Finished testing of SpeedTest *********

Merge request reports