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

Method bench

kdevplatform/outputview/tests/test_outputmodel.cpp:68–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void TestOutputModel::bench()
69{
70 QFETCH(KDevelop::OutputModel::OutputFilterStrategy, strategy);
71 QFETCH(QStringList, lines);
72
73 OutputModel testee(QUrl::fromLocalFile(QStringLiteral("/tmp/build-foo")));
74 testee.setFilteringStrategy(strategy);
75
76 quint64 processEventsCounter = 1;
77 QElapsedTimer totalTime;
78 totalTime.start();
79
80 testee.appendLines(lines);
81 while(testee.rowCount() != lines.count()) {
82 QCoreApplication::instance()->processEvents();
83 processEventsCounter++;
84 }
85
86 QVERIFY(testee.rowCount() == lines.count());
87 const qint64 elapsed = totalTime.elapsed();
88
89 qDebug() << "ms elapsed to add lines: " << elapsed;
90 qDebug() << "total number of added lines: " << lines.count();
91 const double avgUiLockup = double(elapsed) / processEventsCounter;
92 qDebug() << "average UI lockup in ms: " << avgUiLockup;
93 QVERIFY(avgUiLockup < 200);
94}
95
96void TestOutputModel::bench_data()
97{

Callers

nothing calls this directly

Calls 6

elapsedMethod · 0.80
setFilteringStrategyMethod · 0.45
startMethod · 0.45
appendLinesMethod · 0.45
rowCountMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected