CheapPost – Dispatch Speed

It seems that I’ve forgotten how to blog. Instead of fixing the problem directly I thought I might just share some content from emails that I’ve sent out.

This one touches on Robotlegs 2, Dispatch Speed and critical pathways in an application, and, more specifically, why it doesn’t matter that Events in AS3 are a little “slow”.

I’d recommend Robotlegs 2 – especially for modular designs. I was never happy with the modular solutions for RL1.

The library is stable (I’ve been using it in production for months); the only reason for the beta status is that I don’t feel like enough people have given feedback on the API. Also, I haven’t had much time lately to review all the code – but that should change over the holidays.

Regarding the MessageDispatcher – it is a fairly low level tool for synchronous and asynchronous message passing. It is used to bootstrap the framework for example, but it is not a replacement for Signals or Events. Each tool has its place. However, if you are worried about speed…

The Event system in the Flash Player is a very well thought out and well designed Observer pattern implementation. It is good at what it does: offering a way to observe objects. But the performance critical pathways through an application should not be implemented using an observer pattern. Which is why I don’t see Signals as a valid alternative to Events. They might be faster in some situations, but they are still observers. For ultimate speed make direct method calls! If you need an extra layer of abstraction, use callbacks.

Of course, I really need to write a detailed blog post about all of this, but the point is: Events/Signals are observers and you shouldn’t stick them in the middle of performance critical pathways. The performance sensitive aspects of a system should flow through direct method calls (and as few as possible!). For everything else, Events are good enough, and have much better tooling support than Signals if you use a modern IDE.

Haha, “I really need to write a detailed blog post about all of this”.. pffft.

Posted in Uncategorized | Leave a comment