From 00ec50e56d136de41f43c33f39cdbee83f3e4458 Mon Sep 17 00:00:00 2001 From: Ben Peart Date: Wed, 18 Oct 2017 10:27:25 -0400 Subject: read_index_from(): speed index loading by skipping verification of the entry order There is code in post_read_index_from() to catch out of order entries when reading an index file. This order verification is ~13% of the cost of every call to read_index_from(). Update check_ce_order() so that it skips this verification unless the "verify_ce_order" global variable is set. Teach fsck to force this verification. The effect can be seen using t/perf/p0002-read-cache.sh: Test HEAD HEAD~1 -------------------------------------------------------------------------------------- 0002.1: read_cache/discard_cache 1000 times 0.41(0.04+0.04) 0.50(0.00+0.10) +22.0% Signed-off-by: Ben Peart Signed-off-by: Junio C Hamano --- cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 5cc116ba4..177f5ebcf 100644 --- a/cache.h +++ b/cache.h @@ -720,6 +720,7 @@ extern int hold_locked_index(struct lock_file *, int); extern void set_alternate_index_output(const char *); extern int verify_index_checksum; +extern int verify_ce_order; /* Environment bits from configuration mechanism */ extern int trust_executable_bit; -- cgit v1.2.1