I am currently developing a C# .net xna game engine.
I have been trying to figure out a way to have an update manager / scheduler / event system. I currently am using delegates to provide a way to create dynamic scheduled tasks and events.
I have recently read that delegates can be slow. The delegates in my game are being invoked every frame and I was wondering if there can be a performance hit from that?
Update:
I also just found this Link
This is what I was worried about, and I guess there can be a way around it. Thanks for all the other information.
Don’t worry about it – delegates are slightly slower than a regular function call but unless you’re calling them several million times a second I very much doubt that you would notice.
I’d suggest sticking with delegates unless it proves to be a bottleneck.