Michael Peters wrote:
Any links or discussion would be great.

You really need to benchmark it for yourself using the version you are
targetting and the OS. You can do it outside of apache and just have a simple
Perl script that does nothing but sleep after it's created the large data
structure you want. Then use something like top (or whatever the best tool on
your OS is) to see how much memory it takes us.


I'm not sure if the numbers reported are accurate, but if Unix/Linux is used, then you can run the program under "valgrind" or the Unix "time" command (with appropriate flags).

I don't know the details of perl, but I have written various data structures such as hashes in Perl and then C and the C version takes a lot less memory. I'm sure there is overhead because the perl script is interpreted, but there is probably a lot more going on. If you want to see how much memory the data structure (alone) is using, perhaps you (Will) can write two versions of the script...one with and one without the data structure...take the difference, as reported by valgrind, time, or top and you'll get the space used by the data structure.

Ray



Reply via email to