Results 1 to 3 of 3

Thread: QwtCurve faster repaint

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QwtCurve faster repaint

    I have more 4 curves in a plot and each curve have 2000 points in them , these are from the scaled down version from my millions of points in my data, which fed trough the curve by a custom QwtData.

    It seems that when i resize my plot it's sluggish. I bring my number of points down to 1000 on each curve and its acceptable but still a bit sluggish.

    Now, my question is there a spot on qwtdata where i can i tweak . to note I did not reimplement the boundingRect part of QwtData. Do you guys think this will help if i will reimp this part? How often this is called when i don't do autoscaling.

    I really need to go 2000 points on my curve , since i am trying to scale down large sets of data.

    I have had some plots where i feed 150 curves and 32000 points each curve. I have connected my data to the curve by QwtPlotCurve::setData (const double *xData, const double *yData, int size) and this is somehow faster than my 4 curve-plot with my custom QwtData.

    baray98

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtCurve faster repaint

    It seems that when i resize my plot it's sluggish. I bring my number of points down to 1000 on each curve and its acceptable but still a bit sluggish.
    In SVN trunk you find a refreshtest example, that is intended to play with some settings to check the performance of painting a curve. On my box ( an Atom 330 ) I have more than 150 fps for a curve of 10000 points. When 1000 points make your replots sluggish there is something "suboptimal" in your plot/curve settings.

    If the bottleneck is on the painting side I guess you have antialiasing enabled. In combination with a non solid pen you might see a horrible performance.

    Now, my question is there a spot on qwtdata where i can i tweak . to note I did not reimplement the boundingRect part of QwtData. Do you guys think this will help if i will reimp this part? How often this is called when i don't do autoscaling.
    Never.

    ... this is somehow faster than my 4 curve-plot with my custom QwtData ...
    QwtData::x() and QwtData::y() are called for each point when painting the curve line. The same happens when painting the symbols ( in Qwt 6.x each point is requested at once instead of calling x() + y()).

    Without knowing your implementation it is hard to say what could be done faster. But in general you could store the point you have identified for QwtData::x() for the following call of QwtData::y() - or you build an internal cache for your 1000 points, that is recalculated after scale changes only ( not for every resize ).

    Uwe

  3. #3
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtCurve faster repaint

    i actually found my bottle neck its in my custom QwtData::size() this method is called everytime .. it happened to be that i always count my buffer (with iterator) for the size. It has improved a lot. the size method is even called even when i am activating my picker ....

    thanks uwe

Similar Threads

  1. QStringList or QList , which is faster
    By BalaQT in forum Newbie
    Replies: 3
    Last Post: 3rd April 2010, 08:48
  2. Which is faster, drawRect(..) Or drawPath(..) ?
    By nileshsince1980 in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2008, 08:26
  3. Faster paintEvent
    By SailinShoes in forum Qt Programming
    Replies: 1
    Last Post: 1st October 2008, 15:25
  4. Faster code possible?
    By ShaChris23 in forum General Programming
    Replies: 1
    Last Post: 28th May 2008, 07:35
  5. faster QScrollView
    By firas in forum Qt Programming
    Replies: 2
    Last Post: 29th April 2006, 18:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.