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 3488372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:15:46+00:00 2026-05-18T11:15:46+00:00

In the Avoid Creating Objects section of the page Designing for Performance in the

  • 0

In the Avoid Creating Objects section of the page Designing for Performance in the Android Developer documentation I read some paragraphs for which I am not able to visualize a code representation:

An array of ints is a much better than an array of Integers, but this also generalizes to the fact that two parallel arrays of ints are also a lot more efficient than an array of (int,int) objects. The same goes for any combination of primitive types.

  • How would these ‘parallel arrays of ints’ look like? Would it be something like instead of having a method with a signature such as getData():int[][] returning
       [a][b]
       [c][d]
       [e][f]
    

    … it would be better to have two methods, each returning one of the ‘columns’ of data? as in:
    getFirstDimensionData():int[]

       [a]
       [c]
       [e]
    

    and a second one getSecondDimensionData():int[]

       [b]
       [d]
       [f]
    
  • What is an ‘array of (int,int) objects? … something like an array of objects of a-type-not-yet-defined that has two int member instances defining its state?

The immediate next paragraph:

If you need to implement a container that stores tuples of (Foo,Bar) objects, try to remember that two parallel Foo[] and Bar[] arrays are generally much better than a single array of custom (Foo,Bar) objects.

… makes me think that the author is making up some sort of notation. I guess my key question is: is the author of the page using this (somethingX, somethingY) notation to refer to an arbitrary class that ‘wraps’ the elements inside the parentheses?

Finally, is this a standard notation or just something the author of the page created by himself and omitted to explain?

Can anyone, please, shed some light? 🙂

Thanks in advance,

Y

  • 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-18T11:15:46+00:00Added an answer on May 18, 2026 at 11:15 am

    What they’re saying is that

    class foo {
        int a;
        int b;
    }
    
    foo[] bar;
    

    Is slower than

    int[] foo;
    

    With foo[row*2] being a and foo[row*2+1] being b.

    The notation (foo, bar) is trying to symbolize a class that contains foo and bar (like (a,b) in my above example).

    I don’t believe it’s a standard notation, but it wouldn’t be the first time I’ve been proven wrong.

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

Sidebar

Related Questions

Most of Apples documentation seems to avoid using autoreleased objects especially when creating gui
I'm implementing some objects which will have about an equal amount of richness on
How do I avoid read locks in my database? Answers for multiple databases welcome!
How can you avoid circular dependencies when you're designing two classes with a producer/consumer
So essentially my question is this, I am creating an NSMutableDictionary using uint64_t objects
I'm working with a system which had to create objects in one database based
After trying to avoid JavaScript for years, Iv started using Query for validation in
Should developers avoid using continue in C# or its equivalent in other languages to
If I avoid referencing assemblies that don't exist in the silverlight 2.0 runtime, will
I always try to avoid to return string literals, because I fear they aren't

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.