# General performance question -- which is better?

**URL:** https://forum.kirupa.com/t/general-performance-question-which-is-better/312486
**Category:** Uncategorized
**Created:** [August 4, 2010, 5:15pm UTC](https://forum.kirupa.com/t/general-performance-question-which-is-better/312486 "2010-08-04T17:15:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tugboat](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tugboat](https://forum.kirupa.com/u/tugboat)
#### Post date: [August 4, 2010, 5:15pm UTC](https://forum.kirupa.com/t/general-performance-question-which-is-better/312486/1 "2010-08-04T17:15:07Z")

</div>

is it better to: 1) have more enter frame event listeners; or, 2) to ask more of one enter frame event listener?

example:

Is this better?

```auto

for(var i:int = 0; i < 100; i++)
{
	var example:MovieClip = new MovieClip;
	example.addEventListener(Event.ENTER_FRAME, doThis);
	addChild(example);
}

function doThis(e:Event)
{
	var mc:MovieClip = e.target as MovieClip;
	mc.x += 3;

}

```

Or is this better?

```auto

var exampleArray:Array = new Array()
addEventListener(Event.ENTER_FRAME, doThis);

for(var i:int = 0; i < 100; i++)
{
	var example:MovieClip = new MovieClip;
	exampleArray.push(example);
	addChild(example);
}

function doThis(e:Event)
{
	for(var i:int = 0; i <exampleArray.length; i++)
	{
	exampleArray*.x += 3;
	}

}

```

My gut says the second one is better, but I would love confirmation.
