mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
add simple QHash benchmark with reserve
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
6bdb9c688d
commit
d4771af6c7
1 changed files with 13 additions and 0 deletions
|
@ -82,6 +82,7 @@ private slots:
|
|||
void qhash_qt4();
|
||||
void qhash_faster();
|
||||
void qhash_simple();
|
||||
void qhash_simple_reserve();
|
||||
|
||||
private:
|
||||
QString data();
|
||||
|
@ -136,6 +137,18 @@ void tst_QHash::qhash_simple()
|
|||
}
|
||||
}
|
||||
|
||||
void tst_QHash::qhash_simple_reserve()
|
||||
{
|
||||
QHash<int, int> hash;
|
||||
hash.reserve(N);
|
||||
|
||||
QBENCHMARK {
|
||||
for (int i = 0; i < N; i++) {
|
||||
hash[i] = N;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QHash)
|
||||
|
||||
#include "moc_qhash_string.cpp"
|
||||
|
|
Loading…
Add table
Reference in a new issue