Results 1 to 14 of 14

Thread: Qwt 6.0.1 three times slower than 5.2.0

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    Like instant paint being set to false by default but none of them (I had polygon clipping enabled already) seems to affect performance in the way using floats does.
    Well polygon clipping improves performance significantly, when there is something to clip. Guess in your case this is not true ( as long as you don't zoom in/out ), so you might want to disable polygon clipping. AFAIR there was another optimization in Qwt 5.x, that drops points when they are mapped to the same position as its predecessor, what does make sense for integer coordinates only.

    I've build the same app on 64bit Ubuntu (same box) and it works much faster. Plotting 2m points with Qwt 5.2.0 takes 250ms.
    Qwt 6.0.1 is still slower but the difference is not that noticeable - the same 2m points took 400ms to plot.
    I wish I could make it work like that on windows!
    Well with X11 painting is done asynchronously from the X server - so your numbers might compare apples and eggs.
    But the time spent on the X server doesn't depend on doubles or ints - so the overhead of 150 ms is an interesting value.

    When you start your application with "-graphicssystem raster" I would expect to see similar results on Ubuntu like on Windows ?

    Do you have any suggestions how to speed up rendering on windows (except level of details you've already mentioned)?
    5.2.0 speed was acceptable where 6.0.1 is not user friendly at all.
    Of course Qwt ( not application ! ) code is where workarounds should to be added - but in the end it is a Qt problem and should be identified and maybe fixed there too. A small demo ( Qt only ) demonstrating the issue is always required.

    At the moment there are a couple of facts missing:

    • Qt version
    • QPen attributes used
    • QPainter render hints
    • ...

    Uwe

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 106 Times in 103 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    I'm using Qt 4.6.3,
    Painter and pen settings are default (QPainter::TextAntialiasing, pen solid line, 1px black).

    When I've launched the app on Ubuntu with -graphicssystem raster both versions are slower, but not even close to what's happening on windows.
    5.2.0 plots 2m points in 340ms (as oposite to 250ms), 6.0.1 plots 2m points in 770ms (as opposite to 400ms).

    I'll take your suggestion and tomorrow I'll write simple pure Qt app to verify if the issue lies with Qt or not and post it here.

    Anyway, it may be worth considering adding a way of selecting which rendering system to use (int or double) as not everybody (for example me ) needs double precision.

    I'll keep you updated.

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    Quote Originally Posted by Spitfire View Post
    Painter and pen settings are default (QPainter::TextAntialiasing, pen solid line, 1px black).
    The default is a pen width of 0 - a pen width of 1 is running into a different render path and might be significantly slower,

    Uwe

  4. #4
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 106 Times in 103 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    I've done simple Qt example of painting using float and integers (attached) and on windows - the results is the same.
    Floats are dead slow.

    I did some search through Qt bug database and I found an issue complaining about drawpolyline being slow with antialiasing, but it's not the case here.

    Any chances of getting a way of using ints instead of doubles for drawing in Qwt 6.x.x?
    I can't see any other way of making it any faster
    Attached Files Attached Files

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    Do you have a similar effects on 32bit systems - and of course with Qt 4.7.x ?

    Uwe

  6. #6
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 106 Times in 103 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    I don't have access to any 32bit system at the moment, but I'll check it over the weekend and let you know.

  7. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    Quote Originally Posted by Spitfire View Post
    I've done simple Qt example of painting using float and integers (attached) and on windows - the results is the same.
    I checked your code on my box ( Linux/X11, Qt 4.7.3 ):

    • With basic X11 using floats is significantly faster ( about 10-30 % )
    • Enabling the raster paint engine ( -graphicssystem raster ) I can confirm that doubles are much slower ( about 200-250 % )

    So the "right" solution means obviously more than simply using integers instead of floats.

    I will check the code of the raster paint engine why it performs so bad for floats.

    Uwe

  8. #8
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 106 Times in 103 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    I've tested 32bit Windows XP box.

    The problem is the same, with 5.2.0 plot is rendered in 1700ms, with 6.0.1 it takes 5600ms.

    Let me know if you find anything interesting.
    Cheers!

  9. #9
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    In SVN trunk ( Qwt 6.1 ) QwtPlotCurve tries to use QPolygon instead of QPolygonF ( depending on various parameters ).

    If you don't want to have this optimization you can enable the new flag QwtPlotItem::RenderFloats. Like expected setting this flag slows down the frame rate of the refreshtest example, when using the raster graphics system.

    Uwe

  10. #10
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Qwt 6.0.1 three times slower than 5.2.0

    Just one more hint: in Qwt 5.2 was a flag QwtPlotCurve::PaintFiltered that removes points that are mapped to the same position as their predecessor. As long as your samples are not only noise it should have a much bigger impact on the performance than the QPolygon/QPolygonF flag.

    I have reintroduced this optimization to Qwt 6.1 ( QwtPlotCurve::FilterPoints ). In situations, where the curve is rendered to an integer based paint engine ( all beside Svg and Pdf ) I would expect, that it will reduce the polygon heavily for a 2 million point series.

    You can check the refreshtest example to see its effect.

    Uwe

Similar Threads

  1. QVector Slower than STL Vector
    By lynchkp in forum Newbie
    Replies: 3
    Last Post: 5th December 2010, 10:50
  2. Qt 4.6.3 slower than 4.6.2
    By Nik8768 in forum Installation and Deployment
    Replies: 3
    Last Post: 19th July 2010, 12:13
  3. Replies: 6
    Last Post: 15th April 2010, 19:56
  4. Replies: 11
    Last Post: 2nd July 2009, 00:41
  5. why Qt4 is so slower than Qt3 ?
    By xuyaojun1980 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 11th February 2009, 18:32

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.