-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Modifying the block in the middle of the file requires copying the following block #244
Comments
@Johnxjj, it's like you were reading my mind! We've recently included LittleFS and found some cases like this (update in middle of a file) which seemed too slow to be real. In our case a "very large file" is only 64-128KB, and with the flash we're using erasing blocks and writing a new copy after an update near the beginning is taking 1.5s. Using SPIFFS (which has its own issues) such an update is 200-300ms. I'm not sure it's a bug, honestly, as it is a design assumption that might not be so true in general cases. |
@earlephilhower and TD-er,Thank you for your advice. This seems to be a good solution.
|
I've been thinking about this limitation ever since #27. It is an intentional design tradeoff, but not a great one. And it catches people by surprise. So far, every time this crops up there's been a successful workaround, but that may just be a result of the determination of embedded developers. Improving random writes is a bit complicated though. So it's not a problem I've been able to get to yet. My opinion right now is that adopting proper B-trees is the correct solution. Though how they interact with the rest of the filesystem raises a number of questions. One of the more interesting questions: How do you traverse a read-only tree with constant RAM?
|
In the line 398 of DESIGN.md you mentioned:
So suppose this is a very large file, you need to modify the block in the middle of the file, then you need to copy the following blocks of this large file every time, so will it take a lot of time to copy? And Is there any good solution?
The text was updated successfully, but these errors were encountered: