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.