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

Re^2: Speed up hash initialization loop

by austinj (Acolyte)
on Jan 30, 2013 at 15:09 UTC ( #1016079=note: print w/replies, xml ) Need Help??

in reply to Re: Speed up hash initialization loop
in thread Speed up hash initialization loop

There are 300 profiles, getvars only sees each of the profiles once (it takes a profile location as an argument) I am checking to make sure I haven't already ran the profile so as to not run it twice. I switched to the pipe open as suggested (no significant change in runtime) I also changed all hash/array refs to standard hashes and returned the refs as suggested (again no significant runtime change) The files themselves are relatively small and the system command returns approx 30 lines of text which I use in the regex Thanks for the help

  • Comment on Re^2: Speed up hash initialization loop

Replies are listed 'Best First'.
Re^3: Speed up hash initialization loop
by Anonymous Monk on Jan 31, 2013 at 20:56 UTC

    How large will @$vars be? If larger than a hundred elements or so, you will benefit from a Schwartzian transform:

    my @sorted_vars = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map { [ lc $_, $_ ] } @{$vars};

    I'm afraid I'm as out of ideas as the other posters here -- your only recourse is to use a profiler and find the bottlenecks that way.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016079]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2017-11-23 00:59 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (327 votes). Check out past polls.