Performance issues QwtPlot
Hi.
We're experiencing performance issues. We have a customized plot, that is derived from QwtPlot, which receives data every second. Our plot has a history of 60seconds, on the x-axis.
Worst case scenario is 25 curves, with 1500 points per curve, so maximum 37 500 points per second. We've also tried upping the update interval to 4 seconds, with more or less same result.
After some seconds we're experiencing high cpu-load up to 100 %, and we're not quite sure how to improve that. From what I've read 37500 points shouldn't be that much compared to other plotting scenarios.
We're running Ubuntu 11.10, and using Qwt 6.0.1.
Basically we've run out of ideas on what might cause the performance degrading, and would like som pointers on where to start looking if anyone has got any tips to where to start.
Re: Performance issues QwtPlot
There are a lot of parameters, that affect the performance - hard to say, what the reason is in your application without knowing your code.
I recommend to build Qt and Qwt in release mode ( if this is not still the case ) and check the refreshtest example. With this example you can see the performance of a curve plot ( frames per seconds ) in your environment and modify several parameters to understand their impact on the performance.
Potential reasons might be:
- bad X11 configuration
- using gradients for the canvas or plot background
- antialiasing
- using pens with a width > 0
- no polygon clipping, when many points are far outside the visible area
- rich text labels ( scales or plot items )
- ...
You could also try to start your application with the raster graphicsystem. In general it is not recommended ( by me - Nokia seems to think different, as it made it the default for Qt 4.8/X11 ), but it is different and you might detect problems of X11 - like the gradients on my box.
Are there any other plot items - beside the curves ?
Uwe
Re: Performance issues QwtPlot
Hi Uwe.
We turned of antialiasing and that improved the performance. We had bad X11 configuration on one of the machines, but that should be fixed.
In addition to the curves, we have a dotted grid on our canvas. The canvas doesn't have any gradients, it's just black.
We've tried the raster graphicssystem, without any significant change in performance.
We only have a couple of points on each curve outside the visible area.
Thanks for your help.
Gerhard
Re: Performance issues QwtPlot
Overload QwtPlot::drawCanvas and add some simple time measurements using QElapsedTimer.
- How long does it take ( ms ) to do a single call of drawCanvas on your box ?
- When you configure the refreshtest example as close as possible to your situation ( comparable number of points ). What refreshrate do you see, when "Updates" is set to 20ms ?
Uwe
PS: Qwt and Qt are built in release mode ?