PDA

View Full Version : Cost of a signal to signal connection



hiçbirşeyyok
23rd February 2012, 23:15
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.

ChrisW67
24th February 2012, 04:58
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.

amleto
25th February 2012, 18:11
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...