Results 1 to 12 of 12

Thread: Qt4 slow like molasses

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt4 slow like molasses

    Hi,

    I'm in the process of porting an app from Qt3 to Qt4. I have a moderately complex dialog with one list view (QTreeWidget) which is basically empty (it has two items in there) and a handful of buttons. See the two attachments for the Qt3 and Qt4 dialog screenshots.
    In Qt3 resizing the dialog is is really snappy like you would expect from a normal dialog. In Qt4 however, the resize operation is so slow that the buttons seem to 'jump out of the dialog'. They seem to have some kind of momentum and the entire dialog looks distorted. What am I doing wrong. This can't be the normal performance of Qt4, this would not be usable as a commercial application. Any ideas?


    Thomas
    Attached Images Attached Images
    Last edited by Tommytrojan; 16th June 2010 at 23:14.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt4 slow like molasses

    It's hard to say anything based on a screenshot.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt4 slow like molasses

    Could be a goofy layout, 1990 hardware, or any number of things. Have you hand coded the dialog or is it Designer built? Can you post a small compile-able example that shows the behaviour on your machine?

  4. #4
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt4 slow like molasses

    I'll see if I can shoot a video of the two to demo the issue. You can pretty much imagine moving the mouse resizing the window and the window lagging behind about a second or so, looks weird. I think we can exclude the hardware or the OS (Windows 7) since Qt3 is fast as a scalded monkey and Qt4 slow as molasses.

    The layout is pretty simple, there are at most two nested layouts and if that makes it that slow I'd be concerned about the rest of the system. Besides, the layouts are pretty much the same on Qt3 and Qt4. I replaced the QTreeWidget with a QLabel just to make sure it is not something with the QTreeWidget. There is a small speedup but still at least a magnitude slower than Qt3.

    I'll see if I can get a small run-able sample together that exhibits the problem.
    I'm thinking it could have something to do with the layouts, the Vista style, or maybe the fonts and anti-aliasing. Any pointers are welcome.

    Cheers,
    Thomas

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt4 slow like molasses

    Have you tried to compile in release mode? For me, a number of things are very slow in debug mode, but are perfectly usable in release mode.

  6. #6
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt4 slow like molasses

    Good point. I'll try and run the release version. For Qt3 I have been using release code, so that could definitely make a difference. I'll report back as soon as I get a chance to test it.

    T

  7. #7
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt4 slow like molasses

    Quote Originally Posted by fatjuicymole View Post
    Have you tried to compile in release mode? For me, a number of things are very slow in debug mode, but are perfectly usable in release mode.
    Tested in release mode and it is way faster! So that is definitely part of it. However, I tried the same debug version on two other (inferior machines) and the response is immediate, no sluggishness whatsoever! Go figure.

    All systems are 64-bit Windows 7.

    Now the slow system is actually the fastest with a Core 2 Duo T9550 @ 2.67 GHz, 4GB RAM NVIDIA Quadro NVS 160M. Windows Experience: 4.4

    My little netbook is way faster, no delay whatsoever:

    U2300 @ 1.2 GHz, 4GB RAM, built in Intel Graphics, Windows Experience: 3.2

    Desktop:
    AMD Athlon 64 X2 Dual Core 5200+ @ 2.6GHz, 6GB RAM, ATI Radeon X1300 Series (Windows driver - WDDM), Windows Experience: 4.1

    So I figure it can't be the hardware by itself. Maybe the graphics adapter. Although the Nvidia is one of the fastested among these machines.

    The strange thing is that Qt3 runs perfectly fine even on the slow machine. The good news is that there are some systems where it performs fine. It would be good to figure out what the underlying problem is. Looks like it is running slowest on the fastest hardware...

    Cheers,
    Thomas

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt4 slow like molasses

    Quote Originally Posted by Tommytrojan View Post
    It would be good to figure out what the underlying problem is. Looks like it is running slowest on the fastest hardware...
    Try changing your system password...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qt4 slow like molasses

    Quote Originally Posted by Tommytrojan View Post
    The strange thing is that Qt3 runs perfectly fine even on the slow machine. The good news is that there are some systems where it performs fine. It would be good to figure out what the underlying problem is. Looks like it is running slowest on the fastest hardware...
    My experience with Qt4 is that it's very fast on Windows. A simple dialog like this should not lag.
    I can see one reason why it could be lagging and that is if there's not enough processing power to handle the paint events.

    But to be sure you should try to create a minimal working example, or post your code, like already asked above.
    Maybe you did something wrong with the tree widget for example.

  10. #10
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt4 slow like molasses

    Quote Originally Posted by tbscope View Post
    My experience with Qt4 is that it's very fast on Windows. A simple dialog like this should not lag.
    I can see one reason why it could be lagging and that is if there's not enough processing power to handle the paint events.

    But to be sure you should try to create a minimal working example, or post your code, like already asked above.
    Maybe you did something wrong with the tree widget for example.
    Well, it seems to run fast on two of my three machines, so I wouldn't understand how this could be my code, if I'd do something foolish I would expect it to be slow on all machines.

  11. #11
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt4 slow like molasses

    Then it is environmental. Ship your slow machine to me and I'll have a look

    You'll have to work out what else is running on the "slow" machine? Antivirus scanning in the background, Windows updating a search index, zombie process(es) sitting on 100% CPU. Are all the machines running identical versions of the Qt run time libs? What about Windows patches? Switch the slow machine to the generic SVGA driver...
    Last edited by ChrisW67; 18th June 2010 at 02:46.

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt4 slow like molasses

    Quote Originally Posted by Tommytrojan View Post
    I'll see if I can shoot a video of the two to demo the issue.
    I don't think this will help, we believe you that it is slow, no need to convince us. Showing some code would be so much more helpful.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Slow interface
    By Guilo in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2010, 17:32
  2. QGraphicsScene too slow
    By samsam in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2009, 16:18
  3. Spectrogram too slow
    By a_kaa in forum Qwt
    Replies: 2
    Last Post: 9th January 2009, 16:57
  4. Qt4 designer SLOW - how to fix?
    By hvengel in forum Qt Tools
    Replies: 3
    Last Post: 10th January 2008, 12:07
  5. Slow application
    By Pieter from Belgium in forum Qt Programming
    Replies: 3
    Last Post: 17th October 2006, 09:44

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.