PDA

View Full Version : Qwt and big data



Khaine
23rd March 2016, 16:43
I have a question about using Qwt with quite large number of samples. We can easily create a plot by using setSamples from QwtPlotCurve. But what if our plot has like 1000 pixels in width and we have 5 million samples? Is QwtPlotCurve smart enough to pick 1000 adequate samples from 5 million? And if so - is it smart enough to make it efficient? For example using multiple threads to do the job faster? Or maybe there is something in Qwt that is worth using in such case without writing sample selection myself?

Uwe
30th March 2016, 08:11
But what if our plot has like 1000 pixels in width and we have 5 million samples?
If possible it is much better to limit the number of samples outside the render cycle ( QwtPlot::replot ). In case of line plots you could use QwtWeedingCurveFitter, but this is a very heavy algo and even with using a reasonable chunkSize it will be too slow for doing it inside replot.

Is QwtPlotCurve smart enough to pick 1000 adequate samples from 5 million?
In SVN trunk ( aka. Qwt 6.2 ) you find QwtPlotCurve::FilterPointsAggressive. This is a special mode for line plots, where the points are ordered in x or y direction. It is very fast and can be done inside of replot. So if your samples match the criterion it is worth a try.

For example using multiple threads to do the job faster?
In case of scatter plot ( see the scatterplot demo ) there is such a thing. But in general the Qt paint engines are not reentrant and: slow / 4 usually remains being slow.

In case of having the option you could use Qt4/X11 ( using the "native" graphiscsystem ) to have a hardware accelerated backend. When going with Qwt from SVN trunk you could also try the QwtPlotCancas::OpenGLBuffer to have hardware acceleration.

ciao,
Uwe