git/reftable
Patrick Steinhardt b00bcb7c49 reftable/reader: iterate to next block in place
The table iterator has to iterate towards the next block once it has
yielded all records of the current block. This is done by creating a new
table iterator, initializing it to the next block, releasing the old
iterator and then copying over the data.

Refactor the code to instead advance the table iterator in place. This
is simpler and unlocks some optimizations in subsequent patches. Also,
it allows us to avoid some allocations.

The following measurements show a single matching ref out of 1 million
refs. Before this change:

  HEAP SUMMARY:
      in use at exit: 13,603 bytes in 125 blocks
    total heap usage: 7,235 allocs, 7,110 frees, 301,481 bytes allocated

After:

  HEAP SUMMARY:
      in use at exit: 13,603 bytes in 125 blocks
    total heap usage: 315 allocs, 190 frees, 107,027 bytes allocated

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-04-15 10:36:09 -07:00
..
basics_test.c reftable/basics: improve binsearch() test 2024-04-03 09:16:49 -07:00
basics.c reftable/block: fix error handling when searching restart points 2024-04-03 09:16:50 -07:00
basics.h reftable/block: fix error handling when searching restart points 2024-04-03 09:16:50 -07:00
block_test.c reftable/block: merge block_iter_seek() and block_reader_seek() 2024-04-15 10:36:09 -07:00
block.c reftable/reader: iterate to next block in place 2024-04-15 10:36:09 -07:00
block.h reftable/block: move ownership of block reader into struct table_iter 2024-04-15 10:36:09 -07:00
blocksource.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
blocksource.h reftable: add blocksource, an abstraction for random access reads 2021-10-08 10:45:48 -07:00
constants.h reftable: (de)serialization for the polymorphic record type. 2021-10-08 10:45:48 -07:00
dump.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
error.c reftable/error: discern locked/outdated errors 2024-03-25 09:51:11 -07:00
generic.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
generic.h reftable: generic interface to tables 2021-10-08 10:45:48 -07:00
iter.c reftable/block: rename block_reader_start() 2024-04-15 10:36:09 -07:00
iter.h reftable/merged: remove unnecessary null check for subiters 2024-03-04 10:19:39 -08:00
LICENSE
merged_test.c reftable/record: convert old and new object IDs to arrays 2024-03-05 09:10:06 -08:00
merged.c reftable/merged: avoid duplicate pqueue emptiness check 2024-03-04 10:19:40 -08:00
merged.h reftable/merged: make merged_iter structure private 2024-03-04 10:19:30 -08:00
pq_test.c reftable/merged: make subiters own their records 2024-03-04 10:19:39 -08:00
pq.c reftable: allow inlining of a few functions 2024-03-04 10:19:49 -08:00
pq.h reftable: allow inlining of a few functions 2024-03-04 10:19:49 -08:00
publicbasics.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
reader.c reftable/reader: iterate to next block in place 2024-04-15 10:36:09 -07:00
reader.h reftable: read reftable files 2021-10-08 10:45:48 -07:00
readwrite_test.c reftable/record: convert old and new object IDs to arrays 2024-03-05 09:10:06 -08:00
record_test.c reftable/record: use scratch buffer when decoding records 2024-03-05 09:10:06 -08:00
record.c reftable/record: extract function to decode key lengths 2024-04-03 09:16:50 -07:00
record.h reftable/record: extract function to decode key lengths 2024-04-03 09:16:50 -07:00
refname_test.c reftable: honor core.fsync 2024-01-23 13:45:27 -08:00
refname.c reftable/refname: refactor binary search over refnames 2024-04-03 09:16:50 -07:00
refname.h reftable: implement refname validation 2021-10-08 10:45:48 -07:00
reftable-blocksource.h reftable: add blocksource, an abstraction for random access reads 2021-10-08 10:45:48 -07:00
reftable-error.h reftable/error: discern locked/outdated errors 2024-03-25 09:51:11 -07:00
reftable-generic.h reftable: generic interface to tables 2021-10-08 10:45:48 -07:00
reftable-iterator.h reftable: generic interface to tables 2021-10-08 10:45:48 -07:00
reftable-malloc.h reftable: utility functions 2021-10-08 10:45:48 -07:00
reftable-merged.h reftable/stack: use size_t to track stack length 2024-02-06 12:10:08 -08:00
reftable-reader.h reftable: read reftable files 2021-10-08 10:45:48 -07:00
reftable-record.h reftable/record: reuse message when decoding log records 2024-03-05 09:10:06 -08:00
reftable-stack.h reftable: implement stack, a mutable database of reftable files. 2021-10-08 10:45:48 -07:00
reftable-tests.h reftable: add a heap-based priority queue for reftable records 2021-10-08 10:45:48 -07:00
reftable-writer.h reftable: honor core.fsync 2024-01-23 13:45:27 -08:00
stack_test.c Merge branch 'ps/pack-refs-auto' 2024-04-09 14:31:45 -07:00
stack.c reftable/stack: gracefully handle failed auto-compaction due to locks 2024-03-25 09:54:07 -07:00
stack.h reftable/stack: index segments with size_t 2024-02-06 12:10:08 -08:00
system.h reftable/stack: register lockfiles during compaction 2024-03-07 12:34:13 -08:00
test_framework.c reftable: honor core.fsync 2024-01-23 13:45:27 -08:00
test_framework.h reftable: honor core.fsync 2024-01-23 13:45:27 -08:00
tree_test.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
tree.c reftable: introduce macros to allocate arrays 2024-02-06 12:10:08 -08:00
tree.h reftable: a generic binary tree implementation 2021-10-08 10:45:48 -07:00
writer.c Merge branch 'ps/reftable-styles' 2024-02-12 13:16:10 -08:00
writer.h reftable: honor core.fsync 2024-01-23 13:45:27 -08:00