Skip to content
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

Iteration optimisation #107

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sosthene-nitrokey
Copy link
Contributor

This is built on top of #104 and #96, and trussed-dev/littlefs2#33

This PR:

Uses the apis added to trussed-dev/littlefs2#33 to improve the skipping that happens each time in read_dir(_files)_next(). I think the operation is likely still $O(n)$ (with n being the number of files in the directory, but it should be much faster.

It also exposes read_dir(_files)_nth syscalls that make it possible to resume iteration at a certain point without having to iterate n time with read_dir(_files)_next, which is a $O(n^2)$ operation

@sosthene-nitrokey
Copy link
Contributor Author

sosthene-nitrokey commented Mar 14, 2023

The bug mentioned in trussed-dev/littlefs2#33 does not affect this PR anyway because the current behaviour of iteration is to consider any filesystem error as the end of the iteration, which means the bug does not change observed behaviour.

@nickray
Copy link
Member

nickray commented Apr 6, 2023

In favor of this, needs some conflict fixing.

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.

None yet

2 participants