# Is it faster to iterate through BitmapData compared to Array?

**URL:** https://forum.kirupa.com/t/is-it-faster-to-iterate-through-bitmapdata-compared-to-array/234732
**Category:** flash
**Created:** [August 5, 2007, 1:50pm UTC](https://forum.kirupa.com/t/is-it-faster-to-iterate-through-bitmapdata-compared-to-array/234732 "2007-08-05T13:50:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Glidias](https://avatars.discourse-cdn.com/v4/letter/g/e36b37/32.png) [@Glidias](https://forum.kirupa.com/u/Glidias)
#### Post date: [August 5, 2007, 1:50pm UTC](https://forum.kirupa.com/t/is-it-faster-to-iterate-through-bitmapdata-compared-to-array/234732/1 "2007-08-05T13:50:05Z")

</div>

well, what do you think?

Is it faster to iterate through BitmapData’s width and height to gather values as compared to iterating through an Array and getting array\* which links to some ClassObject?

In the sense, rather than getting the values through Array\*.somePropertyOfObject…, you get the values through getPixelAt(1,4), where 1 is the index and 4 is some property of the object that is known/documented by the programmer. Of course, you are limited to only integers from 0 to a certain amount (depending on whether you have transparency enabled as well)…but how much more performance can you squeeze out of this, especially when you have a 800 of such particles to keep track of? Of course, having to ensure integer (int) of thingsl, might be quite a headache in terms of free-style programming, as you might not get the exact precision required.

Your thoughts…Just wondering if there’s a performance boost, and whether it’s worth the trouble…
