Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Schwartzian Transform and memory allocation.

by Abigail-II (Bishop)
on Jun 19, 2002 at 16:40 UTC ( #175776=note: print w/ replies, xml ) Need Help??


in reply to Re: Schwartzian Transform and memory allocation.
in thread Schwartzian Transform and memory allocation.

In that case, you could easily save some memory:

@file_data = map { $_ -> [0]} sort { $a -> [1] cmp $b -> [1]} map {[$_ => (split /\|/) [$variable - 1]]} @file_data;
No need to use a 759 41 element arrays if you can do it with just 2 elements!

Abigail


Comment on Re: Schwartzian Transform and memory allocation.
Download Code
Replies are listed 'Best First'.
Re: Re: Schwartzian Transform and memory allocation.
by ThingFish (Beadle) on Jun 21, 2002 at 16:37 UTC
    Modifying my original code as per Abigail-II's suggestion dropped memory usage an entire meg. Abigail-II++.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2015-08-31 22:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (365 votes), past polls