Git 2.26's Faster Searches Thanks To Multi-Threaded Git-Grep

Written by Michael Larabel in Programming on 11 April 2020 at 12:00 AM EDT. 2 Comments
PROGRAMMING
With the Git 2.26 release at the end of March one of the performance wins comes in the way of Git's grep functionality now being multi-threaded.

Besides multi-threaded git-grep being faster, another interesting anecdote is that it was created by a student developer during last year's Google Summer of Code. Student developer Matheus Tavares wrote a blog post this week about this faster pattern searching in Git 2.26 following his GSoC project in 2019. Git's grep functionality had seen multi-threading work originally in 2010 but Git's internal object store up until now made it perform worse than the sequential grep.

In the end he was able to improve the git-grep performance by over three times on a 4-core / 8-thread system. "In the cached searches, we observed speedups of up to 3.34x over the original code, and almost 5x over the original code with threads re-enabled but without the improvements. Additionally, the working tree searches also got faster with our changes, showing speedups of up to 1.53x."

More details on this multi-threaded win for Git via this blog post. We have also added the git-grep query used for the benchmarks in the research to our Git benchmark.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week