summaryrefslogtreecommitdiff
path: root/pack-revindex.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-07-30 11:47:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-07-30 16:01:19 (GMT)
commit092e5115d1312c0b30348404d3f5b2bb02909342 (patch)
tree8e455e4609b8c9d9fa8221883000839c5614c6a4 /pack-revindex.c
parentf239fff4c183b231134115bc3b38b4f8e3982d3e (diff)
downloadgit-092e5115d1312c0b30348404d3f5b2bb02909342.zip
git-092e5115d1312c0b30348404d3f5b2bb02909342.tar.gz
git-092e5115d1312c0b30348404d3f5b2bb02909342.tar.bz2
merge-ort: reuse path strings in pool_alloc_filespec
pool_alloc_filespec() was written so that the code when pool != NULL mimicked the code from alloc_filespec(), which including allocating enough extra space for the path and then copying it. However, the path passed to pool_alloc_filespec() is always going to already be in the same memory pool, so we may as well reuse it instead of copying it. For the testcases mentioned in commit 557ac0350d ("merge-ort: begin performance work; instrument with trace2_region_* calls", 2020-10-28), this change improves the performance as follows: Before After no-renames: 198.5 ms ± 3.4 ms 198.3 ms ± 2.9 ms mega-renames: 679.1 ms ± 5.6 ms 661.8 ms ± 5.9 ms just-one-mega: 271.9 ms ± 2.8 ms 264.6 ms ± 2.5 ms Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-revindex.c')
0 files changed, 0 insertions, 0 deletions