Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: write hash to disk after memory limit

by Jenda (Abbot)
on Mar 14, 2015 at 00:59 UTC ( [id://1120015]=note: print w/replies, xml ) Need Help??


in reply to Re^2: write hash to disk after memory limit
in thread write hash to disk after memory limit

Do you later use the value as a string or as a number? If you use it as a number, I believe you could save quite a bit of memory by forcing a conversion before storing the data. The way you do it, you end up with a scalar containing both the string and (as soon as you use the number for the first time) the number.

... $DATA{$1}{$2}[$set][$replicate] = 0 + "$3.$4"; } elsif ((/^chr(\S+)\s+(\d+)\s+\d+\s+(\d)\s+(\d+)/) && ($1 ~~ + @CHROMOSOMES) && ($ +4 >= $MINIMUM_COVERAGE)) { $DATA{$1}{$2}[$set][$replicate] = 0 + $3; ...

Jenda
Enoch was right!
Enjoy the last years of Rome.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found