Results 1 to 3 of 3

Thread: Cost of a signal to signal connection

  1. #1
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Cost of a signal to signal connection

    What is the runtime cost (speed, in particular) of a signal to signal connection when compared to a signal to slot connection? To put it more clearly, does a signal1-signal2-slot invocation take a slightly more time than a usual signal-slot invocation with the same argument and connection types, or does it take twice the time of the latter?

    Thanks in advance.

  2. #2
    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: Cost of a signal to signal connection

    One would expect that the majority of time is spent in the slot at the end of the cascaded signals, so that adding another call will not have a significant effect. You can read the source code (src/corelib/kernel/metaobject.* and friends) to find out the specifics.

  3. The following user says thank you to ChrisW67 for this useful post:

    hiçbirÅŸeyyok (24th February 2012)

  4. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Cost of a signal to signal connection

    I can fairly safely say that the cost is not important in virtually all cases. If you are optimising your application and you show that stack time in signal/slot connection code is a problem, then I doubt you should be using Qt in the first place...
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Problem connection Signal and slot
    By tamnv110 in forum Newbie
    Replies: 2
    Last Post: 23rd June 2011, 11:36
  2. How to use Signal through direct connection
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2007, 07:07
  3. Signal connection
    By Lele in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2007, 11:29
  4. cost of emitting signal
    By quickNitin in forum Newbie
    Replies: 1
    Last Post: 29th November 2006, 08:53
  5. signal slot connection
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 4th July 2006, 13:31

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.