All of lore.kernel.org
 help / color / mirror / Atom feed
From: git@jeffhostetler.com
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net,
	Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH v4 0/4] read-cache: speed up add_index_entry
Date: Tue,  4 Apr 2017 21:08:43 +0000	[thread overview]
Message-ID: <20170404210847.50860-1-git@jeffhostetler.com> (raw)

From: Jeff Hostetler <jeffhost@microsoft.com>

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.

This helps performance on very large repositories.

================
Before and after numbers on index with 1M files.
./p0004-read-tree.sh
0004.2: read-tree (1003037)              3.24(2.46+0.72)
0004.3: switch branches (3038 1003037)   7.53(5.66+1.56)

$ ./p0004-read-tree.sh
0004.2: read-tree (1003040)              2.45(1.79+0.61)
0004.3: switch branches (3041 1003040)   6.65(4.22+1.60)

================
Before and after numbers on index with 100K files.

./p0004-read-tree.sh
0004.2: read-tree (103037)              0.30(0.20+0.08)
0004.3: switch branches (3038 103037)   0.65(0.47+0.16)

$ ./p0004-read-tree.sh
0004.2: read-tree (103040)              0.25(0.16+0.07)
0004.3: switch branches (3041 103040)   0.58(0.44+0.13)
================


Jeff Hostetler (4):
  p0004-read-tree: perf test to time read-tree
  read-cache: add strcmp_offset function
  test-strcmp-offset: created test for strcmp_offset
  read-cache: speed up add_index_entry during checkout

 Makefile                      |  1 +
 cache.h                       |  1 +
 read-cache.c                  | 73 ++++++++++++++++++++++++++++++++++++-
 t/helper/.gitignore           |  1 +
 t/helper/test-strcmp-offset.c | 64 +++++++++++++++++++++++++++++++++
 t/perf/p0004-read-tree.sh     | 84 +++++++++++++++++++++++++++++++++++++++++++
 t/t0065-strcmp-offset.sh      | 11 ++++++
 7 files changed, 234 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


             reply	other threads:[~2017-04-04 21:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 21:08 git [this message]
2017-04-04 21:08 ` [PATCH v4 1/4] p0004-read-tree: perf test to time read-tree git
2017-04-04 21:08 ` [PATCH v4 2/4] read-cache: add strcmp_offset function git
2017-04-04 21:08 ` [PATCH v4 3/4] test-strcmp-offset: created test for strcmp_offset git
2017-04-04 21:08 ` [PATCH v4 4/4] read-cache: speed up add_index_entry during checkout git

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170404210847.50860-1-git@jeffhostetler.com \
    --to=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=peff@peff.net \
    --subject='Re: [PATCH v4 0/4] read-cache: speed up add_index_entry' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.