Renamed crystallize_size -> crystal_size
The original name was a bit of a mouthful. Also dropped the default crystal_size in the test/bench runners block_size/4 -> block_size/8. I'm already noticing large amounts of inflation when blocks are fragmented, though I am experimenting with a rather small fragment_size right now. Future benchmarks/experimentation is required to figure out good values for these.
This commit is contained in:
@@ -10592,7 +10592,7 @@ static int lfsr_file_flushshrub(lfs_t *lfs, lfsr_file_t *file) {
|
||||
// holes we don't account for, but we generally don't want a bunch of
|
||||
// small holes in our files anyways.
|
||||
//
|
||||
if (right_align - left_align > lfs->cfg->crystallize_size) {
|
||||
if (right_align - left_align > lfs->cfg->crystal_size) {
|
||||
// allocate a new block
|
||||
lfs_block_t block;
|
||||
int err = lfs_alloc(lfs, &block);
|
||||
|
||||
@@ -280,7 +280,7 @@ struct lfs_config {
|
||||
// TODO document
|
||||
lfs_size_t inline_size;
|
||||
lfs_size_t fragment_size;
|
||||
lfs_size_t crystallize_size;
|
||||
lfs_size_t crystal_size;
|
||||
};
|
||||
|
||||
// File info structure
|
||||
|
||||
@@ -109,7 +109,7 @@ intmax_t bench_define(size_t define);
|
||||
#define CACHE_SIZE_i 5
|
||||
#define INLINE_SIZE_i 6
|
||||
#define FRAGMENT_SIZE_i 7
|
||||
#define CRYSTALLIZE_SIZE_i 8
|
||||
#define CRYSTAL_SIZE_i 8
|
||||
#define LOOKAHEAD_SIZE_i 9
|
||||
#define BLOCK_CYCLES_i 10
|
||||
#define ERASE_VALUE_i 11
|
||||
@@ -125,7 +125,7 @@ intmax_t bench_define(size_t define);
|
||||
#define CACHE_SIZE bench_define(CACHE_SIZE_i)
|
||||
#define INLINE_SIZE bench_define(INLINE_SIZE_i)
|
||||
#define FRAGMENT_SIZE bench_define(FRAGMENT_SIZE_i)
|
||||
#define CRYSTALLIZE_SIZE bench_define(CRYSTALLIZE_SIZE_i)
|
||||
#define CRYSTAL_SIZE bench_define(CRYSTAL_SIZE_i)
|
||||
#define LOOKAHEAD_SIZE bench_define(LOOKAHEAD_SIZE_i)
|
||||
#define BLOCK_CYCLES bench_define(BLOCK_CYCLES_i)
|
||||
#define ERASE_VALUE bench_define(ERASE_VALUE_i)
|
||||
@@ -143,7 +143,7 @@ intmax_t bench_define(size_t define);
|
||||
BENCH_DEF(CACHE_SIZE, lfs_max(16, lfs_max(READ_SIZE, PROG_SIZE))) \
|
||||
BENCH_DEF(INLINE_SIZE, BLOCK_SIZE/8 ) \
|
||||
BENCH_DEF(FRAGMENT_SIZE, CACHE_SIZE ) \
|
||||
BENCH_DEF(CRYSTALLIZE_SIZE, BLOCK_SIZE/4 ) \
|
||||
BENCH_DEF(CRYSTAL_SIZE, BLOCK_SIZE/8 ) \
|
||||
BENCH_DEF(LOOKAHEAD_SIZE, 16 ) \
|
||||
BENCH_DEF(BLOCK_CYCLES, -1 ) \
|
||||
BENCH_DEF(ERASE_VALUE, 0xff ) \
|
||||
@@ -168,7 +168,7 @@ intmax_t bench_define(size_t define);
|
||||
.cache_size = CACHE_SIZE, \
|
||||
.inline_size = INLINE_SIZE, \
|
||||
.fragment_size = FRAGMENT_SIZE, \
|
||||
.crystallize_size = CRYSTALLIZE_SIZE, \
|
||||
.crystal_size = CRYSTAL_SIZE, \
|
||||
.lookahead_size = LOOKAHEAD_SIZE,
|
||||
|
||||
#define BENCH_BDCFG \
|
||||
|
||||
@@ -109,7 +109,7 @@ intmax_t test_define(size_t define);
|
||||
#define CACHE_SIZE_i 5
|
||||
#define INLINE_SIZE_i 6
|
||||
#define FRAGMENT_SIZE_i 7
|
||||
#define CRYSTALLIZE_SIZE_i 8
|
||||
#define CRYSTAL_SIZE_i 8
|
||||
#define LOOKAHEAD_SIZE_i 9
|
||||
#define BLOCK_CYCLES_i 10
|
||||
#define ERASE_VALUE_i 11
|
||||
@@ -125,7 +125,7 @@ intmax_t test_define(size_t define);
|
||||
#define CACHE_SIZE TEST_DEFINE(CACHE_SIZE_i)
|
||||
#define INLINE_SIZE TEST_DEFINE(INLINE_SIZE_i)
|
||||
#define FRAGMENT_SIZE TEST_DEFINE(FRAGMENT_SIZE_i)
|
||||
#define CRYSTALLIZE_SIZE TEST_DEFINE(CRYSTALLIZE_SIZE_i)
|
||||
#define CRYSTAL_SIZE TEST_DEFINE(CRYSTAL_SIZE_i)
|
||||
#define LOOKAHEAD_SIZE TEST_DEFINE(LOOKAHEAD_SIZE_i)
|
||||
#define BLOCK_CYCLES TEST_DEFINE(BLOCK_CYCLES_i)
|
||||
#define ERASE_VALUE TEST_DEFINE(ERASE_VALUE_i)
|
||||
@@ -143,7 +143,7 @@ intmax_t test_define(size_t define);
|
||||
TEST_DEF(CACHE_SIZE, lfs_max(16, lfs_max(READ_SIZE, PROG_SIZE)) ) \
|
||||
TEST_DEF(INLINE_SIZE, BLOCK_SIZE/8 ) \
|
||||
TEST_DEF(FRAGMENT_SIZE, CACHE_SIZE ) \
|
||||
TEST_DEF(CRYSTALLIZE_SIZE, BLOCK_SIZE/4 ) \
|
||||
TEST_DEF(CRYSTAL_SIZE, BLOCK_SIZE/8 ) \
|
||||
TEST_DEF(LOOKAHEAD_SIZE, 16 ) \
|
||||
TEST_DEF(BLOCK_CYCLES, -1 ) \
|
||||
TEST_DEF(ERASE_VALUE, 0xff ) \
|
||||
@@ -168,7 +168,7 @@ intmax_t test_define(size_t define);
|
||||
.cache_size = CACHE_SIZE, \
|
||||
.inline_size = INLINE_SIZE, \
|
||||
.fragment_size = FRAGMENT_SIZE, \
|
||||
.crystallize_size = CRYSTALLIZE_SIZE, \
|
||||
.crystal_size = CRYSTAL_SIZE, \
|
||||
.lookahead_size = LOOKAHEAD_SIZE,
|
||||
|
||||
#define TEST_BDCFG \
|
||||
|
||||
@@ -184,7 +184,7 @@ code = '''
|
||||
seen[tinfo.u.mdir.u.m.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.u.m.blocks[0] % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BTREE) {
|
||||
} else if (tinfo.tag == LFSR_TAG_BRANCH) {
|
||||
printf("traversal: 0x%x btree 0x%x.%x\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.rbyd.block, tinfo.u.rbyd.trunk);
|
||||
@@ -339,7 +339,7 @@ code = '''
|
||||
seen[tinfo.u.mdir.u.m.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.u.m.blocks[0] % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BTREE) {
|
||||
} else if (tinfo.tag == LFSR_TAG_BRANCH) {
|
||||
printf("traversal: 0x%x btree 0x%x.%x\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.rbyd.block, tinfo.u.rbyd.trunk);
|
||||
@@ -484,7 +484,7 @@ code = '''
|
||||
seen[tinfo.u.mdir.u.m.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.u.m.blocks[0] % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BTREE) {
|
||||
} else if (tinfo.tag == LFSR_TAG_BRANCH) {
|
||||
printf("traversal: 0x%x btree 0x%x.%x\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.rbyd.block, tinfo.u.rbyd.trunk);
|
||||
|
||||
Reference in New Issue
Block a user