Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Speed up hash initialization loop

by Anonymous Monk
on Jan 31, 2013 at 20:56 UTC ( #1016391=note: print w/ replies, xml ) Need Help??


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

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.


Comment on Re^3: Speed up hash initialization loop
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2015-07-06 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls