Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:42:34+00:00 2026-05-27T14:42:34+00:00

Is there any performance benefit in storing Arrays in a Vector of type Array?

  • 0

Is there any performance benefit in storing Arrays in a Vector of type Array?

e.g Option 1

private var _arrays:Vector.<Array> =  new Vector.<Array>(2); 
_arrays[0] = new Array(10);
_arrays[1] = new Array(10);

Option 2

private var _arrays:Array =  new Array(2); 
_arrays[0] = new Array(10);
_arrays[1] = new Array(10);

Also can I have a Vector or Vectors?

 private var _vectors:Vector.<Vector> = new Vector.<Vector>(2);

_vectors[0] = new Vector.<String>(10);
_vectors[1] = new Vector.<String>(10);

Thanks,

Mark

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:42:35+00:00Added an answer on May 27, 2026 at 2:42 pm

    EDIT

    My original answer was wrong except for the very last part, and I have to apologize for that. I knew for a fact that Vector has exactly four implementations “under the hood”. (You can find decompiled sources from FP 10 playerglobal.swc in a post by Robert Penner here) Three of those are for number types (int, uint and Number). One is for Object types. This last one serves as a catch-all and takes in all classes derived from Object. This is why I assumed that Vector.<Object> was still faster than Array, relying on the information regarding vectors and arrays available from Adobe.

    However, it seems that this information is wrong, or at least it leaves out some important parts:

    1. While Vector.<AnyClassDerivedFromObject> allows for strict typing, this type information is only evaluated at compilation time (so you get more type safety), but not at runtime – thus essentially the benefits of strict typing object vectors do not apply to performance. See this blog post for more info.

    2. Consequently, the only implementations of Vector that are faster than Array are the ones for number types (!).

    In fact, I have done some extensive testing on this, and have come to the conclusion that while Vector.<int>is up to 60% faster than Array of ints, all the derivates of Vector.<Object> are not only equal in speed (i.e. Vector.<Object> performs the same as Vector.<String>, they also are about 20% slower than Array. I’ve double- and triple-checked this, so I believe the results to be fairly accurate.

    It still is true that the number type vectors are faster, so you should use those for performance benefits over Array. But:

    END EDIT

    Only if you’re going to use sort(), sortOn() or any other of the convenient sorting functions of Array, you might still decide otherwise, because these are native functions, and as such really fast. Implementing your own sorting methods on a Vector will probably not match their speed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if there is any concurrency (now or future), or performance benefit
Is there any performance difference between the for loops on a primitive array? Assume:
Given the following two code options, is there any performance benefit (over a very
Is there any performance benefit in configuring web gardens in IIS? Anyone have any
Is there any performance benefit to using const or readonly fields compared to regular,
I've seen a lot of people do the former, is there any performance benefit
Is there any benefit to performance when I do the following in Mootools (or
Is there any performance benefit to pre-compiling an asp.net web application if it's set
Is there any performance benefit to splitting a large table with roughly 100 columns
Are there any performance benefits to me not using the gridview in asp.net for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.