in reply to Re^3: How to optimize a regex on a large file read line by line ?
in thread How to optimize a regex on a large file read line by line ?

Hi John FENDER. It seems like you might have given up too early, before the cavalry arrived. See Re^2: How to optimize a regex on a large file read line by line ?. Looks like both are even faster than the grep+wc solution, though this would need to be confirmed on your machine.

  • Comment on Re^4: How to optimize a regex on a large file read line by line ?

Replies are listed 'Best First'.
Re^5: How to optimize a regex on a large file read line by line ?
by John FENDER (Acolyte) on Apr 19, 2016 at 23:13 UTC
    Hi ! You have all my code and my number, i can't give more ! On My machine, Grep+Wc are the faster. And the line by line solution are also faster than puttin all the lines in memory, then searching. Cheers.

      marioroy has found that the bigbuffer method (found in http://ideone.com/LzaQI0) runs in 7.8 seconds on his machine, vs the 10.71 seconds you get for grep+wc. What's not known is the relative speed of the two machines. Unfortunately, my machines are in storage while I'm moving, and I'm stuck on this tiny tablet, so I can't run any benchmarks myself. So I ask again, please, can you adopt and run the above code on your machine so we can get accurate results for both the above bigbuffer technique and grep+wc?