Skip to content

Add filesystem index structure#270

Merged
matth-x merged 4 commits intomasterfrom
feature/file-index
Mar 9, 2024
Merged

Add filesystem index structure#270
matth-x merged 4 commits intomasterfrom
feature/file-index

Conversation

@matth-x
Copy link
Owner

@matth-x matth-x commented Mar 9, 2024

Add an index of all stored files in the OCPP folder on the filesystem. MO will look up if a file exists using the index instead of the host system's stat implementation.

On SPIFFS, a high memory usage can lead to a significant slowdown of file operations. That is especially a problem for stat which MicroOcpp uses often and in bursts. The index is a minimal data structure which keeps track of all files existing in the OCPP folder and thereby avoiding stat after the initial enrollment.

To enable, set the build flag MO_ENABLE_FILE_INDEX=1 (disabled by default).

Use it with caution. If MO uses this file index implementation, then all operations on the MO files must go through the same file index instance. This is relevant if files are changed manually while MO is running.

@matth-x matth-x merged commit b5f3723 into master Mar 9, 2024
@matth-x matth-x deleted the feature/file-index branch March 9, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant