git grep --threads 12 --textconv is effectively single-threaded
- From
Zach Riggle <zachriggle@gmail.com>
- Date
- Jul 7, 2020, 21:25 UTC
- Message-ID
- <CAMP9c5nUteg_HouuYJZtq7g4MrSE638mns=HeKhNpNTYgQB4=w@mail.gmail.com>
It looks like the bit of code that is responsible for performing textconv conversions is single-threaded, even if git-grep is provided a number of threads to use.
This greatly limits the usability of textconv filters for grep expressions over a large number of files.
Note the difference in total CPU usage in the following expressions:
$ git grep --threads 12 -e foobar --and -e fizzbuzz &> /dev/null 0.24s user 0.28s system 710% cpu 0.073 total
$ git grep --threads 12 -e foobar --and -e fizzbuzz --textconv &> /dev/null 0.90s user 1.75s system 110% cpu 2.390 total
$ git version git version 2.27.0
Zach Riggle