[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Wed Dec 15 17:51:32 CET 2004
CVS commit by staikos:
more finegrained, demonstrates that lock contention is 0-1 ms max.
M +24 -7 kst2dplot.cpp 1.325
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.324:1.325
@@ -5143,5 +5143,6 @@ void Kst2DPlot::plotCurves(QPainter& p,
#ifdef PLOTBENCH
- QTime bench_time;
+ QTime bench_time, benchtmp;
+ int b_1, b_2, b_3, b_4;
#endif
for (int i_curve = 0; i_curve < (int)Curves.count(); i_curve++) {
@@ -5153,4 +5154,7 @@ void Kst2DPlot::plotCurves(QPainter& p,
overlap = false;
+#ifdef PLOTBENCH
+ benchtmp.start();
+#endif
if (c->sampleCount() > 0) {
Qt::PenStyle style = KstLineStyle[c->lineStyle()];
@@ -5189,14 +5193,10 @@ void Kst2DPlot::plotCurves(QPainter& p,
c->point(i0, rX, rY);
- //
- // if we have an invalid point then start looking backward for the last valid point...
- //
+ // if invalid point then look backward for the last valid point.
while ((isnan(rX) || isnan(rY)) && i0 > 0) {
c->point(--i0, rX, rY);
}
- //
- // if we still have an invalid point then start looking forward for the next valid point...
- //
+ // if invalid point then look forward for the next valid point...
if (isnan(rX) || isnan(rY)) {
i0 = i0Start;
@@ -5435,4 +5435,7 @@ void Kst2DPlot::plotCurves(QPainter& p,
}
} // end if c->hasLines()
+#ifdef PLOTBENCH
+ b_1 = benchtmp.elapsed();
+#endif
//
@@ -5550,4 +5553,7 @@ void Kst2DPlot::plotCurves(QPainter& p,
}
}
+#ifdef PLOTBENCH
+ b_2 = benchtmp.elapsed();
+#endif
p.setPen(QPen(c->color(), (c->lineWidth() < penWidth ? penWidth : c->lineWidth())));
@@ -5602,4 +5608,7 @@ void Kst2DPlot::plotCurves(QPainter& p,
}
}
+#ifdef PLOTBENCH
+ b_3 = benchtmp.elapsed();
+#endif
//
@@ -5701,8 +5710,16 @@ void Kst2DPlot::plotCurves(QPainter& p,
} // end if (c->hasYError())
} // end if (c->sampleCount() > 0)
+#ifdef PLOTBENCH
+ b_4 = benchtmp.elapsed();
+#endif
c->readUnlock();
#ifdef PLOTBENCH
int i = bench_time.elapsed();
printf("Plotting curve %d: %ims\n", i_curve, i);
+ printf(" Without locks: %ims\n", b_4);
+ printf(" Lines: %ims\n", b_1);
+ printf(" Bars: %ims\n", b_2 - b_1);
+ printf(" Points: %ims\n", b_3 - b_2);
+ printf(" Errors: %ims\n", b_4 - b_3);
#endif
} // next curve
More information about the Kst
mailing list