]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/record: convert old and new object IDs to arrays
authorPatrick Steinhardt <ps@pks.im>
Tue, 5 Mar 2024 12:10:59 +0000 (13:10 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Mar 2024 17:10:06 +0000 (09:10 -0800)
commit87ff723018bfca588b5d68e110ab04494c451ebd
tree377c23c0e51fd920fc4db9dbc83b267e24476308
parenteea0d11d6d7114c850e50fa3f247b2ecf9a330fc
reftable/record: convert old and new object IDs to arrays

In 7af607c58d (reftable/record: store "val1" hashes as static arrays,
2024-01-03) and b31e3cc620 (reftable/record: store "val2" hashes as
static arrays, 2024-01-03) we have converted ref records to store their
object IDs in a static array. Convert log records to do the same so that
their old and new object IDs are arrays, too.

This change results in two allocations less per log record that we're
iterating over. Before:

    HEAP SUMMARY:
        in use at exit: 13,473 bytes in 122 blocks
      total heap usage: 8,068,495 allocs, 8,068,373 frees, 401,011,862 bytes allocated

After:

    HEAP SUMMARY:
        in use at exit: 13,473 bytes in 122 blocks
      total heap usage: 6,068,489 allocs, 6,068,367 frees, 361,011,822 bytes allocated

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/reftable-backend.c
reftable/merged_test.c
reftable/readwrite_test.c
reftable/record.c
reftable/record_test.c
reftable/reftable-record.h
reftable/stack_test.c