# Speeding up performance

**URL:** <https://forum.kirupa.com/t/speeding-up-performance/318771>\
**Category:** flash\
**Created:** [January 30, 2011, 1:55am UTC](https://forum.kirupa.com/t/speeding-up-performance/318771 "2011-01-30T01:55:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhiteyMcWhite](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@WhiteyMcWhite](https://forum.kirupa.com/u/WhiteyMcWhite)\
**Post date:** [January 30, 2011, 1:55am UTC](https://forum.kirupa.com/t/speeding-up-performance/318771/1 "2011-01-30T01:55:35Z")

</div>

In my quest for squeezing as much performance out of flash as I possibly can, besides common speedy AS3 practices and smart programming, I’m looking into lower level speed boosts (as I’m hitting the limit with higher level).

For example, I use a LOT of arrays, and a lot of 2D, even 3D arrays;  
I’ve always read that using a 1D array and the (y\*width)+x formula was faster than array access of a 2D array. I’ve been using this method for a while. However I ran a test for myself  
Each method with the same size “grid,” each node storing an Object with a variable called num with a random number, just to have something stored.  
I ran speed tests for accessing this object in each node with as minimal amount of objects I could that would give a time over 0, up to 10 million, and many intervals in between. To my surprise, every time, the 2D array was faster. So I converted everything back. However, in my more realistic simulation, the different in frames/second didn’t seem very noticable.

Another issue, was that in most arrays, the datatypes are all the same, so I looked up the Vector. I replaced all the arrays I could with Vector.\<type\> hoping I would get the speed boost many articles were claiming. However, this still did not seem much different.  
I’m using nested Vector’s though, Vector.\<Vector.\<type\>\>, which may defeat the purpose of hard typing? But I don’t see why.

Anyone have any input?
