perf: gc might try to populate the lookahead buffer each time#1110
perf: gc might try to populate the lookahead buffer each time#1110geky merged 2 commits intolittlefs-project:develfrom
Conversation
Tests passed ✓, Code: 17112 B (+0.0%), Stack: 1448 B (+0.0%), Structs: 812 B (+0.0%)
|
|
Interesting, it looks like you're right, this is needed to avoid redundant lookahead scans when
This gets tricky when But you're right this doesn't feel very optimal. Eventually (the "Config API rework" in #1111), I would like to drop the idea that |
Tests passed ✓, Code: 17112 B (+0.0%), Stack: 1448 B (+0.0%), Structs: 812 B (+0.0%)
|
|
Looks great, thanks for this. Will bring this in on the next patch release. |
|
Sorry about the delay in bringing these in. Unrelated things delayed a patch release. They should be on their way in shortly. Thanks for the contributions! |
Sorry my English is very poor, so I use machine translation.
When the user incorrectly sets lookahead_size, if lookahead_size > (block_count / 8), gc might try to populate the lookahead buffer each time.
I'm not sure if this PR is the optimal solution. Perhaps it should help users set the correct value during the mount stage.
Because similar processing is also done in the lfs_format_ and lfs_alloc_scan functions, in fact, this processing can be completely optimized out.