Archive

Articles taggués ‘array’

AS3 Vector VS Array Benchmark (Read Access : int, String, Bitmap)

 

I have seen some benchmarks about Vector VS Array read access, but I wanted to test it myself. I have tested these data type : int, String and Bitmap.

 

Data type

The datatype used for filling the vector/array : int, String and Bitmap.

 

Loop style

20m = for(n:int=0; n<20000000; ++n)
100m = for(n:int=0; n<100000000; ++n)
(double loop)

Lire la suite…

AS3 Vector.sort() VS Array.sort() Benchmark

 

Working on optimization can be fun, repetitive and mostly painful toward the end.
Here is my benchmark for the sort() function. I wanted to compare Array and Vector performances.

 

This randomizing function has been use as sorting function

test.sort(function(){return Math.floor(Math.random()*3)-1});

 

Data type

The datatype used for filling the vector/array : int

 

Loop style

1m = for(n:int=0; n<1000000; ++n)
2.5m = for(n:int=0; n<2500000; ++n)

Lire la suite…