← index #13209PR #5811
Related · high · value 0.771
QUERY · ISSUE

ESP32(S3) - littlefs - Consistant drop of module loading speed if files are written to filesystem

openby ftylitakopened 2023-12-15updated 2025-09-22
port-esp32

Greetings all,

the past two days i am troubled by a weird behaviour pattern that I was not able to find any answer, so I am posting it here hopping to find a solution.

  • board: ESP32-S3-WROOM-1 and ESP32-WROVER-IE
  • micropython: 1.16, 1.19.1, 1.21
  • file system: littlefs v2

I am running a very simple script.
The scenario is to wake up, write content to a file, load a module and deepsleep.

My observation is that every time a file is written to the file system, the system speed is affected in a consistant pace. After each wakeup from deep sleep, running the same script takes more and more time to execute. At some point it starts executing the scirpt quickly again and starts gradually the speed slow down.

This is the main.py where at the end of the module import, before going to sleep just prints the ticks_ms to use as reference:

import utime

destination = "/testing"
content = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

with open(destination, "w") as file:
    file.write(content)

from onewire import OneWire
from ds18x20 import DS18X20
print("load time: {}".format(utime.ticks_ms()))
utime.sleep_ms(1000)
import machine
machine.deepsleep(1)

And here is the behaviour in multiple setups shown in graphs, where the Y axis is the execution time printed by the line print("load time: {}".format(utime.ticks_ms())) and the X axis is the iteration number:

  • ESP32-S3-WROOM-1 (micropython 1.21.0) - littlefs v2

    • esp32s3-1-21-littlefs
  • ESP32-S3-WROOM-1 (micropython 1.19.1) - littlefs v2

    • esp32s3-1-19-littlefs
  • ESP32-WROVER-IE (micropython 1.16) - littlefs v2

    • esp32-1-16-littlefs
  • ESP32-S3-WROOM-1 (micropython 1.19) - fat

    • esp32s3-1-19-fat

Notes

  • This has to do with the littlefs somehow. fat does not have this behaviour
  • The loading time is directly dependand to some state of the file system because even after a power off/on, the loading speed follows exactly the pattern from where it was before power off.
  • Different content length when writting, affects the rythm of speed decline

An help will be very much appreciated as I have hit a deadend to my investigation.

CANDIDATE · PULL REQUEST

esp32: Change from FAT to littlefs v2 as default filesystem.

mergedby dpgeorgeopened 2020-03-27updated 2020-04-04
port-esp32

This commit changes the default filesystem type for esp32 to littlefs v2. This port already enables both VfsFat and VfsLfs2, so either can be used for the filesystem, and existing systems that use FAT will still work.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied