-
Notifications
You must be signed in to change notification settings - Fork 7.6k
(SD/FS) Batch deletion slowed by openNextFile() #5002
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
If you want code changes, make a PR. |
Rude. Is reporting issues not what the issues section is for? |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hello, I'm marking this one as expired as there was a lot of changes on it. If you still face this issue on latest v2.0.3-RC1, please open a new issue. Thanks for your contribution. |
Hardware:
Board: ESP32 DEVKIT V1
Core Installation version: 1.0.6
IDE name: PlatformIO
Peripherals: SD Card (SPI)
Partition Scheme: FAT32
Description:
Batch deletion of files is very slow due to having to rely on openNextFile().
Consider the script below which:
(1) populates the SD card with 500 2kb gibberish files when 'a' is pressed;
(2) removes 500 files when 'b' is pressed.
The result when pressing 'a', and then 'b' when that is finished, is:
Much of the time spent is not spent removing files but just opening them...
This was partly addressed around 2018-2019 in the discussion following issue #1394 (#1394). The patch provided by driftregion at the time (#1394 (comment)) significantly improves this process and it seems to have unfortunately fallen through the cracks, with none of these changes ever being implemented.
I have cloned the arduino-esp32 framework into /brunojoyal/arduino-esp32-sdfix in which I replaced the FS library with the one patched by driftregion. Putting
in platformio.ini to use this framework, and uncommenting the #def SDFIX line in my test script, we get this result:
Much better.
Question/Request: Would it be possible to include some or all of the changes made by driftregion to the FS library? Most importantly, the getNextFileName() method, or something similar.
Many thanks.
Sketch:
The text was updated successfully, but these errors were encountered: