Results 1 to 17 of 17

Thread: graphicsview performance problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default graphicsview performance problem

    Hi all!
    I have a problem with the performance of a QGraphicsView.
    I made a small example and attached it. For the animation i have to do i need more than 1000 particles.
    I tried it qith OpenGL viewport, optimazion flags and buffers. finally i put the particle system into a thread... nothing helped.
    Im new with QGraphicsView and im sure some of you gurus can help me.
    Attached Files Attached Files

  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: graphicsview performance problem

    The example you provided works quite fast on my computer (with the GL viewport). Could you specify what exactly is the problem?

  3. #3
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: graphicsview performance problem

    try with 2000 particles.
    int calcthread.cpp:
    Init(2000,n_forces,f,Create,vel,pos1,pos2,128,QCol or(0,0,255,255),4);

  4. #4
    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: graphicsview performance problem

    I did. 2000 is still quite fast. With 10000 it's slow, but drawing 10k pixmaps is quite an effort, so I can understand it.

  5. #5
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: graphicsview performance problem

    ?? for me is quiet slow....
    and my dualcore has over 50% processor load.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: graphicsview performance problem

    Use a profiler. It will show you where you should improve your application.

  7. #7
    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: graphicsview performance problem

    I have a single core Athlon 2.5+ with hardware accelerated OpenGL implementation under Linux/X11 and Qt 4.3.3.

    If rendering is too slow for you, try using OpenGL calls to render your items. It should be very fast - after all it's just a bunch of quads with the same texture applied.

  8. #8
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: graphicsview performance problem

    ah!
    i forgott one thing!
    on linux, bsd and mac its quiet fast... but under windows....puah!

    you mean i should implement it fully in opengl? i never worked with opengl.... dou you know any good tutorials?

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: graphicsview performance problem

    First try the profiler. By adding "const &" in certain place and changing one constant you can save about 30% of the CPU time.

  10. #10
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: graphicsview performance problem

    I never used a profiler.
    i tried it with "sleepy", an oo project, but he said 47% of 50% processor load are from KiFastSystemCallRet.
    WTF IS THAT? I think i know now why i hate developing under windows....

  11. #11
    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: graphicsview performance problem

    I suggest trying callgrind or gprof under Linux.

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

    Default Re: graphicsview performance problem

    Quote Originally Posted by wysota View Post
    I suggest trying callgrind or gprof under Linux.
    Well, the problem was described as a Windows only problem.

    Try to render the scene to a QImage, because QImage uses the same paint engine on all platforms, that is used on Windows. If you see the same performance problems with QImage/Linux you can use the tools Witold recommended.

    Most paint engines are frontends to native paint subsystems like X11, but the raster paint engine is a new development in Qt4. So its no surprise, that many problems ( and performance issues ) are related to it.

    Uwe

Similar Threads

  1. GraphicsView rotate problem
    By forrestfsu in forum Qt Programming
    Replies: 7
    Last Post: 21st November 2007, 20:20
  2. GraphicsView performance
    By nileshsince1980 in forum Qt Programming
    Replies: 2
    Last Post: 19th September 2007, 12:19
  3. QTableView Performance Problem on Windows
    By umitoz in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2007, 16:47
  4. GraphicsView performance problems
    By Gopala Krishna in forum Qt Programming
    Replies: 79
    Last Post: 8th August 2007, 17:32
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.