]> git.ipfire.org Git - thirdparty/git.git/commit
diffcore-rename: use a mem_pool for exact rename detection's hashmap
authorElijah Newren <newren@gmail.com>
Fri, 30 Jul 2021 11:47:37 +0000 (11:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Jul 2021 16:01:18 +0000 (09:01 -0700)
commitfa0e936fbb683dbce70b797ae8a5be6b88f48d88
treeedf07ff60d6aa56feedc1992578cd82c03a0c4e4
parent7afc0b03a2307aa02b7caff2746664e886f38d9a
diffcore-rename: use a mem_pool for exact rename detection's hashmap

Exact rename detection, via insert_file_table(), uses a hashmap to store
files by oid.  Use a mem_pool for the hashmap entries so these can all be
allocated and deallocated together.

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:      204.2  ms ±  3.0  ms   202.5  ms ±  3.2  ms
    mega-renames:      1.076 s ±  0.015 s     1.072 s ±  0.012 s
    just-one-mega:   364.1  ms ±  7.0  ms   357.3  ms ±  3.9  ms

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-rename.c