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

[PATCH v6 0/3] read-cache: speed up add_index_entry

From
Ggit@jeffhostetler.com <git@jeffhostetler.com>
Date
Apr 6, 2017, 16:34 UTC
Message-ID
<20170406163442.36463-1-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>

Version 6 combines the strcmp_offset() function and unit tests into a single commit and places it first in the history, so that it can be isolated into a separate patch series if desired. It also clarifies the return value when the strings are equal. The commit message for the actual speed up now includes the perf numbers (rather than having them here in the cover letter).

================ Teach add_index_entry_with_check() and has_dir_name() to avoid index lookups if the given path sorts after the last entry in the index.

This saves at least 2 binary searches per entry.

This improves performance during checkout and read-tree because merge_working_tree() and unpack_trees() processes a list of already sorted entries.

Jeff Hostetler (3):
  read-cache: add strcmp_offset function
  p0004-read-tree: perf test to time read-tree
  read-cache: speed up add_index_entry during checkout
 Makefile                      |   1 +
 cache.h                       |   1 +
 read-cache.c                  |  64 ++++++++++++++++++++++-
 t/helper/.gitignore           |   1 +
 t/helper/test-strcmp-offset.c |  64 +++++++++++++++++++++++
 t/perf/p0004-read-tree.sh     | 117 ++++++++++++++++++++++++++++++++++++++++++
 t/t0065-strcmp-offset.sh      |  11 ++++
 7 files changed, 258 insertions(+), 1 deletion(-)
 create mode 100644 t/helper/test-strcmp-offset.c
 create mode 100755 t/perf/p0004-read-tree.sh
 create mode 100755 t/t0065-strcmp-offset.sh
-- 
2.9.3
Next: git@jeffhostetler.com
Message 1 of 9 in “read-cache: speed up add_index_entry”
  1. 0/3 read-cache: speed up add_index_entrygit@jeffhostetler.com, Apr 6, 2017
  2. 1/3 read-cache: add strcmp_offset functiongit@jeffhostetler.com, Apr 6, 2017
  3. René ScharfeApr 6, 2017
  4. Jeff HostetlerApr 7, 2017
  5. 2/3 p0004-read-tree: perf test to time read-treegit@jeffhostetler.com, Apr 6, 2017
  6. 3/3 read-cache: speed up add_index_entry during checkoutgit@jeffhostetler.com, Apr 6, 2017
  7. Jeff KingApr 7, 2017
  8. Jeff HostetlerApr 7, 2017
  9. Jeff KingApr 8, 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.