Sign in to follow this  
HexDump

Boost::Signals for iphone, too heavy?

Recommended Posts

Hi!,

I like Boost::Signals a lot. I ussually include it in every game I do (like message systems). Now, I'm building an iphone game, and I noticed something I never were aware of... signals lib is 1 MB by itself, that's a lot for a movile device. And this leads me to think if it is a good option for my game. I haven't dived too much into the lib, I just know how to use it, so, for all boost gurus, do you think boost::signals is an option for iphone? Is it too processor hungry for what it does?.

Thanks in advance,
HexDump.

Share this post


Link to post
Share on other sites
1MB does seem large, but it's not unreasonably large (Infinity Blade for the iPad is over 200MB). My opinion is that just liking the lib isn't enough reason to include it - do you really need it? Objective-C is a message based language - each function call can be thought of as an event being sent, and the receiver doesn't need to exist (in which case 0 is returned). If you need multiple receivers of an event consider using notifications.

Share this post


Link to post
Share on other sites
Personally, I don't care about 1MB, even on my phone. but, are You sure you are not using a debug build because the shared library I have for Linux is only 78KB. Though, I don't know how much including the header's would contribute.

Share this post


Link to post
Share on other sites
Hi!,

@Kambiz

Yes, that was what I was thinking about: "perhaps I was compiling it in debug mode" I have to check it.

@stevenmarky

Yes, ObjC has this featured built-in, but I'm using C++ with a little objc wrapper.

In the other hand a little design thing. For a centralized event management system, would you use a map with key the event type and value the signal that will be connected to the listeners? or do you think it is too much bloated :).

Thanks in advance,
HexDump.

Share this post


Link to post
Share on other sites
Just the lib itself is 1MB? I don't think it will add this much to your actual executable size as unused symbols will be stripped out when you link to it. I was concerned about this when playing with luabind a while ago, the lib it was generating was like 10-20MB (I can't remember) but it hardly added anything to my actual executable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this