Skip to content

Commit 5a6f1b1

Browse files
committed
Added LFS3_2BONLY for a small 2-block configuration
Like LFS3_RDONLY and LFS3_KVONLY, LFS3_2BONLY opts-out of all of the logic necessary for filesystems larger than 2-blocks (the mimimum size of a mutable littlefs image). This has potential for some pretty big savings: - No block allocation - No btrees (but yes bshrubs) - No bptrs - No mtree traversal Which is I guess ~1/4 of the codebase: code stack ctx default: 37836 2416 636 2bonly: 28284 (-25.2%) 1872 (-22.5%) 612 (-3.8%) This can be combined with LFS3_KVONLY for a small key-value store compatible with the full littlefs driver: code stack ctx default: 37836 2416 636 kvonly: 30792 (-18.6%) 2168 (-10.3%) 636 (+0.0%) kvonly+2bonly: 23444 (-38.0%) 1736 (-28.1%) 612 (-3.8%) It may be possible to optimize this further, but, as is the case with LFS3_KVONLY, balancing config-specific optimization vs maintainability is tricky. --- I'm not sure why, but this also reduced the default build's size a bit. Compiler noise? code stack ctx before: 37860 2416 636 after: 37836 (-0.1%) 2416 (+0.0%) 636 (+0.0%)
1 parent 2c27c61 commit 5a6f1b1

File tree

3 files changed

+235
-59
lines changed

3 files changed

+235
-59
lines changed

0 commit comments

Comments
 (0)