diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2017-10-12 08:02:20 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-13 09:26:12 +0900 |
commit | 0e87b85683df145007862d23b5f0773368d66464 (patch) | |
tree | 0a161be63357ebaa4bce24a5e64c9f4664e9bee8 /Documentation/git-worktree.txt | |
parent | sha1_name: parse less while finding common prefix (diff) | |
download | tgif-0e87b85683df145007862d23b5f0773368d66464.tar.xz |
sha1_name: minimize OID comparisons during disambiguation
Minimize OID comparisons during disambiguation of packfile OIDs.
Teach git to use binary search with the full OID to find the object's
position (or insertion position, if not present) in the pack-index.
The object before and immediately after (or the one at the insertion
position) give the maximum common prefix. No subsequent linear search
is required.
Take care of which two to inspect, in case the object id exists in the
packfile.
If the input to find_unique_abbrev_r() is a partial prefix, then the
OID used for the binary search is padded with zeroes so the object will
not exist in the repo (with high probability) and the same logic
applies.
This commit completes a series of three changes to OID abbreviation
code, and the overall change can be seen using standard commands for
large repos. Below we report performance statistics for perf test 4211.6
from p4211-line-log.sh using three copies of the Linux repo:
| Packs | Loose | HEAD~3 | HEAD | Rel% |
|-------|--------|----------|----------|-------|
| 1 | 0 | 41.27 s | 38.93 s | -4.8% |
| 24 | 0 | 98.04 s | 91.35 s | -5.7% |
| 23 | 323952 | 117.78 s | 112.18 s | -4.8% |
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-worktree.txt')
0 files changed, 0 insertions, 0 deletions