Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Comparing memory requirements for hashes and arrays

by perrin (Chancellor)
on Sep 04, 2001 at 03:22 UTC ( #109961=note: print w/replies, xml ) Need Help??


in reply to Comparing memory requirements for hashes and arrays

In my experience, hashes use about 15% more memory than arrays for similar data with constants for array indexes. This is not a good enough reason to obscure your program. Use the data structure that makes the most sense for your code and will be the most readable for future maintainers.
  • Comment on Re: Comparing memory requirements for hashes and arrays

Replies are listed 'Best First'.
Re2: Comparing memory requirements for hashes and arrays
by pmas (Hermit) on Sep 04, 2001 at 07:07 UTC
    Your experienced guess is good enough for me, brother perrin. Thank you++.

    And 15% more for hash is is small price to pay for convenience and flexibility of hashes, as tilly said. We need to store also keys. 15% is less than I expected... /me have no more concerns about using hashes. Thank you all!

    pmas
    To make errors is human. But to make million errors per second, you need a computer.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://109961]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2022-06-29 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (94 votes). Check out past polls.

    Notices?