Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Space Efficiency of Hashes

by Joost (Canon)
on Mar 16, 2005 at 00:32 UTC ( [id://439828]=note: print w/replies, xml ) Need Help??


in reply to Space Efficiency of Hashes

This all depends on how much you are exactly storing in your hash tables, but this code should give you a hint, just run it and watch top or some other resource monitor:
#!perl -w use strict; $|=1; my (%a,%b,%c); for (0 .. 500_000) { # set higher if you dare $a{$_} = "x" x 60; # 60 character string $b{$_} = "x" x 60; $c{$_} = "x" x 60; print "\rrow $_" unless $_ % 10000; }

note: this goes up to 190 mb for about 500_000 iterations on my machine YMMV.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-16 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found