Jump to content
  • Advertisement
Sign in to follow this  
Rainweaver

[.net] MultiCast Delegate performance

This topic is 3880 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone, At the moment I'm working on an user interface with Lua scripting. I've managed to register and send events to the scripts. This relies on the use of delegates, as one could expect. Each registered handler is chained with the previous existing handler for that event. Once needed, the event is fired, thus invoking all handlers sequentially. I've grown concerned about execution speed, and I've considered other options, such as dynamic code generation; creating a method on the fly which includes calling directly to the delegate targets (I assume I'll manage to extract the classes Lua generates at runtime). Instead of having many invokes, I would only have one, which would take care of the rest of the calls. Since I expect a lot of handlers to be invoked, I thought this could help. Do you think this might improve performance, or it's just going to make my life harder? Sounds like a feasible option, or there are better methods you could shed a light on? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Quote:

Do you think this might improve performance, or it's just going to make my life harder?


Probably both.

Really, just take care in making that interface nice and clean (so you can swap the implementation out later) and go with the easy way for now. If it becomes a problem, investigate solutions then.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!