Limited FRAGMENT_SIZE to 512 bytes in the test/bench runners
This prevents runaway O(n^2) behavior on devices with extremely large block sizes (NAND, bs=~128KiB - ~1MiB). The whole point of shrubs is to avoid this O(n^2) runaway when inline files become necessarily large. Setting FRAGMENT_SIZE to a factor of the BLOCK_SIZE humorously defeats this. The 512 byte cutoff is somewhat arbitrary, it's the natural BLOCK_SIZE/8 FRAGMENT_SIZE on most NOR flash (bs=4096), but it's probably worth tuning based on actual device performance.
This commit is contained in:
@@ -118,7 +118,7 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
BENCH_DEFINE(GC_STEPS, 0 ) \
|
||||
BENCH_DEFINE(GC_COMPACT_THRESH, 0 ) \
|
||||
BENCH_DEFINE(INLINE_SIZE, BLOCK_SIZE/4 ) \
|
||||
BENCH_DEFINE(FRAGMENT_SIZE, BLOCK_SIZE/8 ) \
|
||||
BENCH_DEFINE(FRAGMENT_SIZE, LFS_MIN(BLOCK_SIZE/8, 512) ) \
|
||||
BENCH_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \
|
||||
BENCH_DEFINE(FRAGMENT_THRESH, -1 ) \
|
||||
BENCH_DEFINE(ERASE_VALUE, 0xff ) \
|
||||
|
||||
Reference in New Issue
Block a user