开发者

Fastest C++ Signal/Slot Lib without dependency

I am going to pass data up/开发者_开发百科down a 5-10 layered object using signals and slots. Which should result in a few thousand signal per sec. Which is far form "I clicked a button". All my object will also signal them self on a timer about every 100ms so they can do some processing.

What would be the fastest C++ Signal/Slot implementation which would be small and not require other library such as boost. (I need to keep the total size of my Binary very small).

I have seen libSigC++, sigSlot, Cpp-Events,


How about Signals by pbhogan:

https://github.com/pbhogan/Signals

It's super fast (uses the FastDelegate code written by Don Clugston - also mentioned by Ismael), and it's pretty easy to use. I've been using it for some time now and had no problems.


Often signal libraries are designed for ease of utilization, and not with a heavy performance in mind. You can check this article maybe helpful while pursuing fast execution.

In your case I'd start trying the more simple, like sigslot. But I'd not use a signal library under such circumstances... probably some kind of message queue, with a time stamp of some kind.


Even most complex and feature-rich signal/slot libraries are quite lightweight. The speed of signal emitting is in most cases comparable to virtual function call. In case of template-driven libraries such as boost::signals and libsigc++ you get essentially the same performance as you'd get passing function pointers around.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜