git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/6] thread lazy_init_name_hash

From
Ggit@jeffhostetler.com <git@jeffhostetler.com>
Date
Mar 22, 2017, 17:14 UTC
Message-ID
<1490202865-31325-1-git-send-email-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>

This patch series is a performance optimization for lazy_init_name_hash() in name-hash.c on very large repositories.

This change allows lazy_init_name_hash() to optionally use multiple threads when building the the_index.dir_hash and the_index.name_hash hashmaps. The original code path has been preserved and is used when the repo is small or the system does not have sufficient CPUs.

A helper command (t/helper/test-lazy-init-name-hash) was created to demonstrate performance differences and validate output. For example, use the '-p' option to compare both code paths on a large repo.

During our testing on the Windows source tree (3.1M files, 500K folders, 450MB index), this change reduced the runtime of lazy_init_name_hash() from 1.4 to 0.27 seconds.

This patch series replaces my earlier
     * jh/memihash-opt (2017-02-17) 5 commits
patch series.
Jeff Hostetler (6):
  name-hash: specify initial size for istate.dir_hash table
  hashmap: allow memihash computation to be continued
  hashmap: Add disallow_rehash setting
  name-hash: perf improvement for lazy_init_name_hash
  name-hash: add test-lazy-init-name-hash
  name-hash: add perf test for lazy_init_name_hash
 Makefile                            |   1 +
 cache.h                             |   1 +
 hashmap.c                           |  29 ++-
 hashmap.h                           |  25 ++
 name-hash.c                         | 490 +++++++++++++++++++++++++++++++++++-
 t/helper/test-lazy-init-name-hash.c | 264 +++++++++++++++++++
 t/perf/p0004-lazy-init-name-hash.sh |  19 ++
 7 files changed, 820 insertions(+), 9 deletions(-)
 create mode 100644 t/helper/test-lazy-init-name-hash.c
 create mode 100644 t/perf/p0004-lazy-init-name-hash.sh
-- 
2.7.4
Next: git@jeffhostetler.com
Message 1 of 14 in “thread lazy_init_name_hash”
  1. 0/6 thread lazy_init_name_hashgit@jeffhostetler.com, Mar 22, 2017
  2. 3/6 hashmap: Add disallow_rehash settinggit@jeffhostetler.com, Mar 22, 2017
  3. 4/6 name-hash: perf improvement for lazy_init_name_hashgit@jeffhostetler.com, Mar 22, 2017
  4. 1/6 name-hash: specify initial size for istate.dir_hash tablegit@jeffhostetler.com, Mar 22, 2017
  5. 2/6 hashmap: allow memihash computation to be continuedgit@jeffhostetler.com, Mar 22, 2017
  6. 6/6 name-hash: add perf test for lazy_init_name_hashgit@jeffhostetler.com, Mar 22, 2017
  7. 5/6 name-hash: add test-lazy-init-name-hashgit@jeffhostetler.com, Mar 22, 2017
  8. Stefan BellerMar 22, 2017
  9. Jeff HostetlerMar 22, 2017
  10. Junio C HamanoMar 22, 2017
  11. Junio C HamanoMar 22, 2017
  12. Jeff HostetlerMar 22, 2017
  13. Junio C HamanoMar 22, 2017
  14. Junio C HamanoMar 22, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.