A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: Flat Array vs Multidimensional Array

  1. #21
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    25% Eh? Probably just your computer. I'm using a turd pc at my fiance's house and I got:

    PHP Code:
    Starting test... Please wait
    Times cycled
    10000
    Array1
    614
    Array2
    626
    %: 1.01954397394137
    Starting test
    ... Please wait
    Times cycled
    10000
    Array1
    611
    Array2
    628
    %: 1.0278232405892
    Starting test
    ... Please wait
    Times cycled
    10000
    Array1
    615
    Array2
    622
    %: 1.01138211382114 
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  2. #22
    Developer
    Join Date
    Apr 2007
    Location
    UK
    Posts
    324
    Hmm

    Those results are a bit weird cos from that test it looks like the multidimensional array is faster. I think this is because it takes time for Flash to evaluate map2[0*w+j] for the flat array.

    Also, I downloaded your Flash 9 source (which is AS2 by the way) and modified it for AS3 and it still looks like the multidimensional array was faster.

    Even more argument to use multidimensional then...
    Attached Files Attached Files

  3. #23
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by Cortana
    Also, I downloaded your Flash 9 source (which is AS2 by the way) and modified it for AS3 and it still looks like the multidimensional array was faster.
    Yes, in AS3 accessing multidimensional array is much faster then flat array with width.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center