]> git.ipfire.org Git - thirdparty/git.git/commit - read-cache.c
read-cache: load cache entries on worker threads
authorBen Peart <benpeart@microsoft.com>
Wed, 10 Oct 2018 15:59:38 +0000 (11:59 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Oct 2018 06:32:48 +0000 (15:32 +0900)
commit77ff1127a4ca340fb9e81861a9851b0c3701bdc1
treee8609ce68976f016703ab21c9e3123a0c8537440
parent3255089ada6fc8f18d41dfc37cf66d7af994603d
read-cache: load cache entries on worker threads

This patch helps address the CPU cost of loading the index by utilizing
the Index Entry Offset Table (IEOT) to divide loading and conversion of
the cache entries across multiple threads in parallel.

I used p0002-read-cache.sh to generate some performance data:

Test w/100,000 files reduced the time by 32.24%
Test w/1,000,000 files reduced the time by -4.77%

Note that on the 1,000,000 files case, multi-threading the cache entry parsing
does not yield a performance win.  This is because the cost to parse the
index extensions in this repo, far outweigh the cost of loading the cache
entries.

The high cost of parsing the index extensions is driven by the cache tree
and the untracked cache extensions. As this is currently the longest pole,
any reduction in this time will reduce the overall index load times so is
worth further investigation in another patch series.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c