in reply to Re: How to speed up multiple regex in a loop for a big data?
in thread How to speed up multiple regex in a loop for a big data?

Come to think of it, why are you sorting the keys?
  • Comment on Re^2: How to speed up multiple regex in a loop for a big data?

Replies are listed 'Best First'.
Re^3: How to speed up multiple regex in a loop for a big data?
by ruzam (Curate) on May 25, 2006 at 15:51 UTC
    Hey, you're right!

    I was about to example a case for partial keys getting substituted, but then I realized the keys are wrapped in word boundries, so there's no chance of partial key substitution, and no reason to sort.

    Drop the sort and save some time.
Re^3: How to speed up multiple regex in a loop for a big data?
by MonkInPleasanton (Initiate) on May 25, 2006 at 16:06 UTC
    You are right on unnecessary sorting. I copied over that part from somewhere and wasn't aware of what I was doing...