in reply to Array vs. Hash

Are there downsides for using a hash I am not considering?

A fully populated 2000x2000 entry HoHs will require around 250MB. Well within the bounds of any modern system. Even my smartphone can handle it. And you can iterate the entire thing in a couple of seconds, so performance isn't an issue.

Whether it is the best mechanism for your particular application rather depends on whether this is a one-off program, or if it needs to be run many times per day (or hour or minute); and where the data to populate that HoHs comes from and what you do with it when the program ends.

The more information you are able to give about the needs and restraints of the application, the more likely you are to get a meaningful assessment of the options available to you.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: Array vs. Hash
by Anonymous Monk on Feb 25, 2012 at 02:08 UTC

    Thanks Grandfather for reformatting this post. This humble acolyte will endeavor not to make the same error again.

    The purpose of the app is to perform some basic data analysis on students. This is a one off project. I will be performing the analysis a few times on different data sets and compare the results.

    Based on the suggestions, I have implemented using HoH. The application is working, and I am getting usable results

    Thanks!

      The purpose of the app is to perform some basic data analysis on students. This is a one off project. I will be performing the analysis a few times on different data sets and compare the results.

      Then the hash is the perfect choice for your needs :)


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?