in reply to Re^6: Refactoring a large script
in thread Refactoring a large script

Did you produce a set of timings with the sort factored out of the inner loop, but without the grep?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^8: Refactoring a large script
by mdunnbass (Monk) on Jan 23, 2007 at 16:04 UTC
    Not yet, I'll be setting that up this afternoon.

    You beat me to the punch on that one. I was already planning it. :D

    Update: Here is the original sub's run times:

    Total Elapsed Time = 1135.701 Seconds User+System Time = 770.4718 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 63.8 491.8 491.86 1 491.86 491.86 main::WEED 32.5 251.1 251.10 22012 0.0114 0.0114 main::SEARCHFASTA

    And here it is without the switch to grep, but keeping the sorting fixes you suggested, as well as most of your other helps:

    Total Elapsed Time = 789.7615 Seconds User+System Time = 741.4615 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 65.4 485.3 485.35 1 485.35 485.35 main::WEED 33.5 248.8 248.86 22012 0.0113 0.0113 main::SEARCHFASTA 0.96 7.120 7.120 1 7.1200 7.1200 main::INDEX_FASTA

    So, removing the double sorting shaved off 6.5 seconds. It's a start.. Now, to try and shave off another 300 or so more....

    Matt