diff options
author | Elijah Newren <newren@gmail.com> | 2021-07-30 11:47:43 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-30 09:01:19 -0700 |
commit | 092e5115d1312c0b30348404d3f5b2bb02909342 (patch) | |
tree | 8e455e4609b8c9d9fa8221883000839c5614c6a4 /t/t4013/diff.show_--root_initial | |
parent | merge-ort: store filepairs and filespecs in our mem_pool (diff) | |
download | tgif-092e5115d1312c0b30348404d3f5b2bb02909342.tar.xz |
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 't/t4013/diff.show_--root_initial')
0 files changed, 0 insertions, 0 deletions