MCPcopy Create free account
hub / github.com/KDE/kdevelop / bench_kdevhash

Method bench_kdevhash

kdevplatform/serialization/tests/bench_indexedstring.cpp:136–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void BenchIndexedString::bench_kdevhash()
137{
138 const QVector<QString> strings = generateData();
139 QVector<QByteArray> byteArrays;
140 byteArrays.reserve(strings.size());
141 for (const auto& string : strings) {
142 byteArrays << string.toUtf8();
143 }
144
145 quint64 sum = 0;
146 QBENCHMARK {
147 for (const auto& array : std::as_const(byteArrays)) {
148 sum += KDevHash() << array;
149 }
150 }
151 QVERIFY(sum > 0);
152}
153
154void BenchIndexedString::bench_qSet()
155{

Callers

nothing calls this directly

Calls 4

KDevHashClass · 0.85
generateDataFunction · 0.70
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected