Re: faster fast grep

2013-05-01 Thread Ted Unangst
On Wed, May 01, 2013 at 04:28, J?r?mie Courr?ges-Anglas wrote: Ted Unangst t...@tedunangst.com writes: For simple patterns, grep has an optimization to avoid regex and run about 50% faster. The problem is its idea of simple patterns is too simple. IIUC the idea is to optimize for a lazy

faster fast grep

2013-04-30 Thread Ted Unangst
For simple patterns, grep has an optimization to avoid regex and run about 50% faster. The problem is its idea of simple patterns is too simple. This diff switches the logic around from a whitelist to a blacklist. We only need to abort the fast path if we see a magic regex character. Index:

Re: faster fast grep

2013-04-30 Thread Jérémie Courrèges-Anglas
Ted Unangst t...@tedunangst.com writes: For simple patterns, grep has an optimization to avoid regex and run about 50% faster. The problem is its idea of simple patterns is too simple. IIUC the idea is to optimize for a lazy user that didn't want to type grep -F or fgrep: $ grep foo /bar $