-
Notifications
You must be signed in to change notification settings - Fork 13.3k
LittleFS is terribly slow at saving settings (partial file rewrite) #7271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a known "design choice" of LittleFS: littlefs-project/littlefs#244 The simplest thing I can suggest is to split the file into objects. Make a subdir of the name of the file, and record individual objects in their own files in that subdir. OTW, I suggest you open a new issue on upstream https://github.com/ARMmbed/littlefs/ to let them know that this design choice kind of sucks for a large class of applications... |
I've been thinking about this a bit more. Is that some limit you're aware of? |
File handles are just extra memory. There's no hard-coded limit in littlefs or the 8266 File class. However, what you're discussing seems like basically making a new filesystem with all the corner cases/etc. that any other would need. Just in this case, instead of writing to flash, you're writing to a 4K file in LittleFS (which then writes to flash). If it's just export/import, what about a basic streaming format like |
There are no other known alternatives: it's either spiffs or littlefs. Spiffs upstream went stale, so we deprecated that for now. I suppose somebody could pick up spiffs maintenance, but it's been three years now. |
What term do you plan for the deprecated state of SPIFFS and when is it no longer available in this library? As mentioned, LittleFS is in our use case not a good replacement for SPIFFS, so I do need to dig into it to make our file handling fit LittleFS. |
Per internal discussions, spiffs won't get pulled any time soon. The earliest, and this likely won't happen given the limitation reported here, would be v3. |
Thanks. |
As also mentioned before in #5932
I have now changed the code in ESPEasy to be able to switch between SPIFFS and LittleFS using a single define (or simply changing the PIO env label). See: letscontrolit/ESPEasy#3052
So I will now be testing LittleFS a lot on my test environments.
The read speed of Little FS is a lot (!!) faster than SPIFFS, but the write speed of our settings is awfully slow.
Saving settings:
During write the node is completely blocked, so this is unacceptable slow.
The settings file we have is way too large to keep in memory.
I only update a part in the file (always start at multiple of 1k block in the file).
I would like to know what would be the best approach for fixing this as SPIFFS was unusable slow for larger file systems (> 1 MB), but this is really unusable slow for writes. (updates in a file)
The text was updated successfully, but these errors were encountered: