среда, 24 октября 2012 г.

Tricks / Starling Optimization (EN) / Updated

From may of 2012 in Starling started using pattern pool of objects for events. So for every dispatch of event new instance doesn't create. Here example:

//ordinary. Create instance
dispatchEvent(new Event(Event.COMPLETE));

//new. Use pool of Events

One more point to start using custom Starling Events nor Robert Penner Signals. Actually I'm in love with Signals. But here was one problem - Starling uses custom Events but Feathers (ex-Foxhole) has used Signal. But now about one week Josh (author of Feathers) had move from Signals to Starling Events. I think it's better.

Be aware there some snake pit: Pool of objects can return you object that still used other event handler. That requires more trust to third-part handlers.


By the way, here is wiki page, about this trick. And one more - about pass and cache additional date with events.

Комментариев нет:

Отправить комментарий

Press Any Key...