summaryrefslogtreecommitdiff
path: root/alias.c
diff options
context:
space:
mode:
authorLibravatar Jeff Hostetler <jeffhost@microsoft.com>2017-03-23 13:47:03 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-24 11:00:03 -0700
commit846df809bc671d6487fa2be7550e3ed2b62e62f9 (patch)
treebe5bef35e037d77e35ff690250b670a1d4705258 /alias.c
parenthashmap: document memihash_cont, hashmap_disallow_rehash api (diff)
downloadtgif-846df809bc671d6487fa2be7550e3ed2b62e62f9.tar.xz
name-hash: perf improvement for lazy_init_name_hash
Improve performance of lazy_init_name_hash() when ignore_case is set. Teach name-hash to build the istate.name_hash and istate.dir_hash simultaneously using a forward-diving technique on the pathname of the index_entry, rather than adding name_hash entries and then searching backwards in the pathname for parent directories. This borrows algorithm ideas from clear_ce_flags_{1,dir}. Multiple threads are used with the new algorithm to speed hashmap construction. This new code path is only used when threads are present (a compiler settings) and when the index is large enough to warrant the pthread complexity. The code in clear_ce_flags_dir() uses a linear search to find the adjacent index entries with the same prefix; a binary search is used here handle_range_dir() to further speed things up. The size of LAZY_THREAD_COST was determined from rough analysis using: t/helper/test-lazy-init-name-hash --analyze Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'alias.c')
0 files changed, 0 insertions, 0 deletions