- 
                Notifications
    You must be signed in to change notification settings 
- Fork 931
Description
From what I can tell, compaction/garbage collection only occurs as the file system is being used (written to).
On devices with longer erase times (I'm currently looking at a part that takes 1.6 seconds to erase 32kB), this will lead to poor performance during write function calls if compaction/garbage collection is needed.
It would be very useful to have a separate API that the system integrators can call to explicitly initiates a rounds of compaction/garbage collection. An API like this would allow them to schedule expensive erase operations at times that have less likelihood of impacting their system's write performance.
An example of where this may be useful, is for when data is only intermittently/periodically being written to flash, but when it does, it needs to be written as quickly as possible. Garbage collection can then be performed over the longer time periods between the write bursts, ensuring that the flash is in a readily written to state by the time the next series of write calls occurs.
While this may not eliminate the need for all compaction/garbage collection during write calls, it has the potential to improve the consistency of write call durations.