Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: A better way to make the script run faster?

by SuicideJunkie (Vicar)
on Jul 31, 2013 at 13:27 UTC ( #1047267=note: print w/replies, xml ) Need Help??

in reply to A better way to make the script run faster?

Doing 27 million of anything is going to take a while.

I should note that =~/^$gl[$index]$/ is better written as eq $gl[$index] unless you have regex metacharacters in your @gl which you have not shown.

A better way to go about this, is to scan @hfr_genes and count the genes using a hash, which will have {LYPLA1 => 13245, CD9=> 42, MYC=>13, ...}. That way, you only scan through your 73372 values ONCE. Then print the tallies by looping over the 375 values once.

73372 + 375 << 73372 * 375 ;)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047267]
[Discipulus]: thanks marto i'll read it after an urgent phonecall
[choroba]: I configured signature font to 2pt size, so I don't care
[choroba]: Moreover, I don't find the Big Lebowski quote offensive
Lady_Aleena wishes she could format her signature a bit without getting metaphorical hives.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-06-23 09:13 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (539 votes). Check out past polls.