in reply to Compiling Search/Replace Regexs

If you thought the regex was causing the problem, a subroutine may or may not be faster.

You need to Benchmark your code with data representative of your application. If you post a sample of what you're really trying to do, some nice monk here might collect all of the ideas into a benchmark and post it here (which you can then run on your target system for comparison).

BTW, how do you know it was the regex?

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^2: Compiling Search/Replace Regexs
by InterGuru (Sexton) on Sep 03, 2005 at 19:50 UTC
    I knew it was the regex slowing me down, by forcing a compilation with the o modifier, my code immediatly sped up ( with the wrong results ). The final version using the compilation system I showed sped up the wall clock running time to do cnn.com from 22 seconds to 7 seconds,