Results 1 to 2 of 2

Thread: QObject overhead

  1. #1
    Join Date
    Mar 2009
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default QObject overhead

    Hi,

    Could anyone tell me how much would be QObject overhead in terms of
    a. memory
    b. performance, speed

    Could any suggest how to calculate it

    -Sriky

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

    Default Re: QObject overhead

    QObject adds a few virtual methods and the whole P-IMPL infrastructure. To calculate memory overhead, you'd have to calculate sizeof(QObject)+sizeof(QObjectPrivate) but the latter is inaccessible from public code so you have to calculate it manually. As for performance, you can make a simple benchmark using Q_BENCHMARK. A single QObject doesn't give much overhead but if you have thousands of them, the overhead starts to be significant especially during creation and destruction.
    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. QGraphicsItem doesn't inherit QObject?
    By xyzt in forum Qt Programming
    Replies: 6
    Last Post: 26th September 2011, 14:59
  2. py2app-deployed PyQt app -- throws QObject threading error
    By tory108 in forum Installation and Deployment
    Replies: 4
    Last Post: 20th January 2009, 20:16
  3. QObject and copy Constructors
    By December in forum Qt Programming
    Replies: 5
    Last Post: 17th July 2008, 16:14
  4. Replies: 1
    Last Post: 31st October 2007, 14:14
  5. Reparenting a QObject
    By ghorwin in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2007, 17:21

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.