Very large array - Android

Asked

Viewed 72 times

0

Which ones problems I could face in the manipulation of arrays many a great?

When I say arrays I mean at least 25, each containing +of 1000 index.

  • Performance:

Would my application’s performance be affected? I say for example, when loading Activity or changing a data from an index.

  • Correct form:

In this case it would be more recommended to use a Arraylist<>? If so, why?

  • 25 arrays ? This is certainly something wrong with the design. Shouldn’t it rather be an array of objects each having 25 fields ? Personally I don’t see many reasons to need 25 separate arrays

1 answer

4


In this order of magnitude (1000), you don’t have to worry. If it were a million elements... but don’t do premature optimizations. Test, profile and then draw your conclusions.

The container issue depends on what you’re going to do with the data, not the pure performance. Will you access the data randomly (by index) or sequentially? Will the matrix have to change size? Each container meets a different demand.

  • Type, 1k is almost the minimum, can reach up to 20k each, in vdd

  • 2

    Right, but it still doesn’t. These days I did a routine image processing in pure Java, performs several calculations on a matrix of 1600x1200x3 (~6M elements) and the speed surprised. To give you an idea, won iOS/Swift in debug mode...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.