reftable/record: reuse message when decoding log records
commite0bd13beea95fa26fa1159a26051f21237f45088
authorPatrick Steinhardt <ps@pks.im>
Tue, 5 Mar 2024 12:11:12 +0000 (5 13:11 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Mar 2024 17:10:06 +0000 (5 09:10 -0800)
tree5452293565a101dc8cb6643915de35f651a52673
parent193fcb3ff82184c3c7b7e3d0da9d0b7aaa648b91
reftable/record: reuse message when decoding log records

Same as the preceding commit we can allocate log messages as needed when
decoding log records, thus further reducing the number of allocations.
Before:

    HEAP SUMMARY:
        in use at exit: 13,473 bytes in 122 blocks
      total heap usage: 3,068,488 allocs, 3,068,366 frees, 307,122,961 bytes allocated

After:

    HEAP SUMMARY:
        in use at exit: 13,473 bytes in 122 blocks
      total heap usage: 2,068,487 allocs, 2,068,365 frees, 305,122,946 bytes allocated

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