in reply to Re: Re: Re: Hitting memory limit? (ActiveState Perl)
in thread Hitting memory limit? (ActiveState Perl)

Regarding memory optimization, and the information provided in the "poor man's hash" link... would there be any value to switching the primary data structure to a straight array, and using a hash as a lookup index (so the # of primary keys in the hash would be the same, but the value would be nothing more than a element # in the array) ?
  • Comment on Re: Re: Re: Re: Hitting memory limit? (ActiveState Perl)

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Hitting memory limit? (ActiveState Perl)
by BrowserUk (Patriarch) on Jan 23, 2004 at 01:45 UTC

    In a word, no. The overhead of a scalar (the hash values) is the same regardless of what it contains. Using a hash to point into an array would just add the overhead of the entire array structure.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Timing (and a little luck) are everything!