stealth/grab — pull request #2 by ggreer (2014-12-22 00:17:48+00:00)
Title: Performance improvement

Hi there. I'm the author of [ag](https://github.com/ggreer/the_silver_searcher). I saw grab on HN today and downloaded and compiled it. I quickly found a bit of low-hanging fruit: FileGrep::find is calling pthread_mutex_lock/unlock for every file searched, even if there are no results to print. I added some simple logic to avoid unnecessary mutex locking. In my benchmarks, this PR speeds up grab by about 25%.