diff options
author | Matheus Tavares <matheus.bernardino@usp.br> | 2020-01-15 23:39:59 -0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-17 13:52:14 -0800 |
commit | 70a9fef2402ff22db7691c6e3134943e1a4c1e1a (patch) | |
tree | e8f3d461051afeba82ed8d7abf741655ac816239 /t/t4000-diff-format.sh | |
parent | grep: re-enable threads in non-worktree case (diff) | |
download | tgif-70a9fef2402ff22db7691c6e3134943e1a4c1e1a.tar.xz |
grep: move driver pre-load out of critical section
In builtin/grep.c:add_work() we pre-load the userdiff drivers before
adding the grep_source in the todo list. This operation is currently
being performed after acquiring the grep_mutex, but as it's already
thread-safe, we don't need to protect it here. So let's move it out of
the critical section which should avoid thread contention and improve
performance.
Running[1] `git grep --threads=8 abcd[02] HEAD` on chromium's
repository[2], I got the following mean times for 30 executions after 2
warmups:
Original | 6.2886s
-------------------------|-----------
Out of critical section | 5.7852s
[1]: Tests performed on an i7-7700HQ with 16GB of RAM and SSD, running
Manjaro Linux.
[2]: chromium’s repo at commit 03ae96f (“Add filters testing at DSF=2”,
04-06-2019), after a 'git gc' execution.
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4000-diff-format.sh')
0 files changed, 0 insertions, 0 deletions