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

IO: Improve scan performance with Root & Shizuku #1000

Merged
merged 9 commits into from
Feb 7, 2024
Merged

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Feb 4, 2024

Less back and forth between SD Maid and root/shizuku processes when traversing nested directories. If we handle all the traversing on one side (in one process) then we don't have to proxy extra calls for each directory through the IPC buffer. 🥳

TODO: Some of the access type mechanisms fail when with this optimisation, i.e. tries NORMAL, but not ADB when in Mode.AUTO 🤔

Perform path tree walking at lower access levels (i.e. SAF & Local(Normal/ADB/Root)).
This reduces overhead and in allows for more optimization.
In the case of ADB/Shizuku and Root this reduces the back and forth between processes and through the IPC buffer:
Instead of multiple and repeated `lookupFiles` between SD Maid and the Shizuku/Root process, we only have one call and return the list of of all nested files.
The downside is that we can't use filters with anonymous functions anymore as we can't pass those through the IPC buffer.
…in` filters can be passed through the IPC.

This allows some scanners like AppScanner to also work with the faster `direct` walking.
…ad()`

Just like with LocalPath.listFiles, we can't rely on just `canRead` as this return `true` even if `listFiles` will throw an exception.
@d4rken d4rken added enhancement New feature, request, improvement or optimization c: IO SAF/Normal/Root access labels Feb 4, 2024
@12Lu-uchiha

This comment was marked as spam.

@d4rken d4rken marked this pull request as ready for review February 7, 2024 13:31
@d4rken d4rken merged commit 2c0bd9f into main Feb 7, 2024
@d4rken d4rken deleted the io_low_level_walking branch February 7, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: IO SAF/Normal/Root access enhancement New feature, request, improvement or optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants