pmas has asked for the wisdom of the Perl Monks concerning the following question:
Now, thinking about reading one record of data: I can fetch array, or hashref. Reading into hash structure looks more promising (field values will be placed in hash elements, conveniently named as fieldnames), obviously it is for the price. But what is the price? I do not know how to find it.
I am aware that premature optimization is evil, but before developing rules and guidelines I would like to know consequences of my decision. I can benchmark access time and compare hash and array, but how about memory usage? Right now it is not a big issue, but later my scripts should run website with dozens of daily users, using mod_perl.
Before reading source, I would like to tap vast knowledge of our monks here and ask:
pmas
To make errors is human. But to make million errors per second, you need a computer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing memory requirements for hashes and arrays
by Cine (Friar) on Sep 03, 2001 at 23:25 UTC | |
by tilly (Archbishop) on Sep 03, 2001 at 23:41 UTC | |
|
Re: Comparing memory requirements for hashes and arrays
by toma (Vicar) on Sep 04, 2001 at 09:30 UTC | |
|
Re: Comparing memory requirements for hashes and arrays
by perrin (Chancellor) on Sep 04, 2001 at 03:22 UTC | |
by pmas (Hermit) on Sep 04, 2001 at 07:07 UTC |