1

I'm just curious how much overhead I might incur in a program that... abuses signals and slots ridiculously. Our app has almost everything connected via signals and slots. We've replaced calling functions with signals and slots for general data flow so we're passing data along a crazy chain.

I've already shown some concern on the design on this to see how easy it will be to debug/follow later but I'm curious about the performance we'll see. We have a small app now, but I imagine we'll see some issues as the program grows out of control.

Just to give a small idea of how much we are abusing signals, we are emiting a signal to call a logging function

Kevin
  • 320
  • 5
  • 17
  • 1
    Like anything performance related, the answer is, "it depends." You will have to measure it. – BillRobertson42 Feb 06 '13 at 15:08
  • I don't think this question can be answered theoretically, without any real-world tests and performance benchmarks. Of course signals&slots have some negative impact on performance, but nobody would know how much. – KBart Feb 06 '13 at 15:09
  • http://stackoverflow.com/questions/10838013/large-use-of-signals-and-slots-does-affect-application-performance – Nemanja Boric Feb 06 '13 at 15:09
  • 2
    I would be more concerned about the logical structure of the application if you are replacing simple function calls with signals. Signal/slot system is a great tool, but you shouldn't try to replace simple function calls with it just because you can. Always remember [KISS](http://en.wikipedia.org/wiki/KISS_principle). –  Feb 06 '13 at 15:21
  • @Bill Ah I was almost hoping someone explored this before, I imagine that tieing a logging system to slots and signals is going to have a bit of overhead when you think about how many times you could call it in a single function, or a while loop... – Kevin Feb 06 '13 at 16:11
  • See also this question: http://stackoverflow.com/questions/5038829/efficiency-of-qt-signals-and-slots –  Feb 06 '13 at 16:15
  • @Roku Oh i noticed the issue with logical structure, but since the people involved don't really understand c++ or object oriented design I was hoping I could persuade them that there was a clear performance issue doing it this way. – Kevin Feb 06 '13 at 18:03
  • 1
    Yeah, I understand your problem. Maybe you can tell them that there definitely will be performance problems. With software maintenance. –  Feb 06 '13 at 19:31

0 Answers0