# Optimization question!

**URL:** <https://forum.kirupa.com/t/optimization-question/310104>\
**Category:** flash\
**Created:** [June 1, 2010, 5:15pm UTC](https://forum.kirupa.com/t/optimization-question/310104 "2010-06-01T17:15:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolea](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@Nicolea](https://forum.kirupa.com/u/Nicolea)\
**Post date:** [June 1, 2010, 5:15pm UTC](https://forum.kirupa.com/t/optimization-question/310104/1 "2010-06-01T17:15:51Z")

</div>

Ok, so this has been bugging me for a while. I’ve had the nagging thought of eventListeners vs container looping.

For example, you could create a bunch of objects and store them in an array; make a loop that traverses the array and tells each object to execute a method. In contrast I could tie an eventListener to the object in it’s constructor function that tells it to perform a task every frame. Does anyone here know which would be more efficient? And on this note does anyone know of a good way of testing different techniques for optimization? I haven’t been able to find any. Thank you!!! :pirate3:
