Commit 49388e93 authored by Boudewijn Rempt's avatar Boudewijn Rempt

benchmarks: add some more simple benchmarks for the datamanager

svn path=/trunk/koffice/; revision=1079700
parent b9f04300
......@@ -52,8 +52,45 @@ void KisDatamanagerBenchmark::benchmarkWriteBytes()
QBENCHMARK {
dm.writeBytes(bytes, 0, 0, 1024, 1024);
}
delete[] bytes;
}
void KisDatamanagerBenchmark::benchmarkReadBytes()
{
quint8 *p = new quint8[3];
memset(p, 0, 3);
KisDataManager dm(3, p);
quint8 *bytes = new quint8[3 * 1024 * 1024];
memset(bytes, 0, 3 * 1024 * 1024);
QBENCHMARK {
dm.readBytes(bytes, 0, 0, 1024, 1024);
}
delete[] bytes;
}
void KisDatamanagerBenchmark::benchmarkReadWriteBytes()
{
quint8 *p = new quint8[3];
memset(p, 0, 3);
KisDataManager dm(3, p);
quint8 *bytes = new quint8[3 * 1024 * 1024];
memset(bytes, 0, 3 * 1024 * 1024);
QBENCHMARK {
dm.readBytes(bytes, 0, 0, 1024, 1024);
dm.writeBytes(bytes, 0, 0, 1024, 1024);
}
delete[] bytes;
}
QTEST_KDEMAIN(KisDatamanagerBenchmark, GUI)
#include "kis_datamanager_benchmark.moc"
......@@ -30,6 +30,8 @@ private slots:
void initTestCase();
void benchmarkCreation();
void benchmarkWriteBytes();
void benchmarkReadBytes();
void benchmarkReadWriteBytes();
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment