diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-05-13 10:18:38 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-13 17:02:39 -0700 |
| commit | f663d34306d414bca27cf6b5dc7affb00e8603fe (patch) | |
| tree | bc9bbb0beb771f18a52fbc8b49e486e1ee35685a /reftable/stack_test.c | |
| parent | afbdbfae0b44efe470c6c7998822900c61f71e39 (diff) | |
reftable: make the compaction factor configurable
When auto-compacting, the reftable library packs references such that
the sizes of the tables form a geometric sequence. The factor for this
geometric sequence is hardcoded to 2 right now. We're about to expose
this as a config option though, so let's expose the factor via write
options.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/stack_test.c')
| -rw-r--r-- | reftable/stack_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/reftable/stack_test.c b/reftable/stack_test.c index d15f11d712..0f7b1453e6 100644 --- a/reftable/stack_test.c +++ b/reftable/stack_test.c @@ -729,7 +729,7 @@ static void test_suggest_compaction_segment(void) { uint64_t sizes[] = { 512, 64, 17, 16, 9, 9, 9, 16, 2, 16 }; struct segment min = - suggest_compaction_segment(sizes, ARRAY_SIZE(sizes)); + suggest_compaction_segment(sizes, ARRAY_SIZE(sizes), 2); EXPECT(min.start == 1); EXPECT(min.end == 10); } @@ -738,7 +738,7 @@ static void test_suggest_compaction_segment_nothing(void) { uint64_t sizes[] = { 64, 32, 16, 8, 4, 2 }; struct segment result = - suggest_compaction_segment(sizes, ARRAY_SIZE(sizes)); + suggest_compaction_segment(sizes, ARRAY_SIZE(sizes), 2); EXPECT(result.start == result.end); } |
