Performance optimization is nice and all, but... how often will that
happen in a frame? Once? A few hundred times? Then go with whatever is
the easiest to understand, because you're still at fractions of a
milisecond. Try it -- just time how long it takes to call a
getInstance method a few thousand times or send as many events. I'd
expect the Singletons to be slightly faster, especially if a new event
object would have to be instantiated each time, but then, I don't see
the relation between them and events. Perhaps you could give an
example of a situation where both would be equaly valid options?

If you have a situation where it would actually make a measurable
difference in performance, then you'd probably want to go without any
of the two.

Mark



On Wed, Sep 3, 2008 at 3:16 PM, S0 F1 <[EMAIL PROTECTED]> wrote:
> Any thoughts on whether it's more efficient (in terms of development and
> player performance) to use Singleton's (with static public 'getInstance' or
> such) instead of Event's when developing mid-sized applications? (for
> classes that *are* Singleton's of course). Asking this in regards to when
> you know no other class needs notification.
>
> It seems a lot cleaner in terms of code (not having to create and listen for
> events). Just a direct call - but what about performance speed, etc.
>
> Is this good practice.
>
> Cheers.
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to