[Kst] branches/work/kst/portto4/kst/src/libkst
Mike Fenton
mike at staikos.net
Tue Apr 28 18:25:18 CEST 2009
SVN commit 960557 by fenton:
Add benchmarking for update process.
M +26 -0 updatemanager.cpp
--- branches/work/kst/portto4/kst/src/libkst/updatemanager.cpp #960556:960557
@@ -20,6 +20,13 @@
#define MAX_UPDATES 2000
+#define BENCHMARK 0
+
+#if BENCHMARK
+ QTime bench_time, benchtmp;
+ int b1 = 0, b2 = 0;
+#endif
+
namespace Kst {
static UpdateManager *_self = 0;
@@ -109,6 +116,10 @@
#if DEBUG_UPDATE_CYCLE > 0
qDebug() << "UM - Beginning update for" << object->Name();
#endif
+#if BENCHMARK
+ bench_time.start();
+ benchtmp.start();
+#endif
object->beginUpdate(object);
_updateRequests.removeAll(object);
}
@@ -168,6 +179,11 @@
qDebug() << "\tUM - All primitive updates complete updating relations for update of" << updateObject->shortName();
qDebug() << "\t Current dependentUpdate requests" << _dependentUpdateRequests;
#endif
+#if BENCHMARK
+ int i = bench_time.elapsed();
+ b1 = i;
+ qDebug() << endl << "Time to update Primitives " << ": " << i << "ms";
+#endif
_dispatchingRequests.append(updateObject);
foreach (ObjectPtr object, _dependentUpdateRequests[updateObject]) {
_dependentUpdateRequests[updateObject].removeAll(object);
@@ -194,6 +210,11 @@
qDebug() << "\tUM - All relation updates complete, updating plots for update of" << updateObject->shortName();
qDebug() << "\t Current display update list" << _displayUpdateRequests;
#endif
+#if BENCHMARK
+ int i = bench_time.elapsed();
+ b2 = i;
+ qDebug() << endl << "Time to update Relations " << ": " << i - b1 << "ms";
+#endif
foreach (QList<PlotItemInterface*> objectList, _displayUpdateRequests) {
foreach (PlotItemInterface* object, objectList) {
object->updateObject();
@@ -206,6 +227,11 @@
} else {
qDebug() << "UM - updates not complete: not updating plots: count:" << _updateRequests.count();
#endif
+#if BENCHMARK
+ i = bench_time.elapsed();
+ qDebug() << endl << "Time to notify Plots " << ": " << i - b2 << "ms";
+ qDebug() << endl << "Total Time to process update " << ": " << i << "ms";
+#endif
}
}
}
More information about the Kst
mailing list