Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Very Large Arrays

by dave_the_m (Monsignor)
on Feb 14, 2012 at 20:13 UTC ( [id://953761]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Very Large Arrays
in thread Very Large Arrays

I reasoned that 3 times that gives 48M in 1.5GB. Then replace the ints with the pointers and add 48mx20 (rounded up to 24) = 1.01GB for the strings themselves. gives 2.5GB total; and around 60 seconds to shuffle. Did I miss something?
Yes: an int is stored entirely within an SV head, whereas a string needs an SV body too, as well as the string itself (which may also have some malloc overhead).

I used the following code to get my estimate:

my $max = 10_000_000; my @a; system "ps -flyp $$"; $a[$max] = 0; # pre-extend array $a[$_] = '4.90032E-8,1.25327E-7' for 0..$max; system "ps -flyp $$";
Dave.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found