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

Switch to interactive root shell #2018

Closed
SuperSandro2000 opened this issue Sep 22, 2018 · 8 comments
Closed

Switch to interactive root shell #2018

SuperSandro2000 opened this issue Sep 22, 2018 · 8 comments

Comments

@SuperSandro2000
Copy link

SD maid would run a bit faster if you would use an interactive root shell and not doing 7 root requests to launch app control.

@d4rken
Copy link
Member

d4rken commented Sep 23, 2018

What do you mean by "launch app control"?

@SuperSandro2000
Copy link
Author

When I simply launch the app control in SD Maid the app does a total of 7 root requests to magisk. Maybe decrease them cause each su request is an intensive operation.

@d4rken
Copy link
Member

d4rken commented Sep 23, 2018 via email

@d4rken d4rken added the c: Core label Sep 23, 2018
@SuperSandro2000
Copy link
Author

SuperSandro2000 commented Sep 23, 2018

Cold start does 7 root requests and reload does two. I don't expect to bring it down to one but maybe 2 or 3 if it is easily achievable.

@d4rken d4rken added this to the Next Tasks milestone Oct 28, 2018
@d4rken d4rken modified the milestones: Next Tasks, v4.12.0 Nov 22, 2018
@d4rken
Copy link
Member

d4rken commented Nov 22, 2018

Base setup

  1. RootContext, shell launch is part of su test
  2. Binary setup, shell is launched once for all applet tests to know if they work with root
  3. Storage setup, one shell for all storage modules to get their data
  4. Storage setup, private data module starts another shell ❓

AppControl

  1. Loading process data, e.g. running apps
  2. Perform a check for hidden apps when loading app data, check for instant apps
  3. Another check for hidden apps ❓

@d4rken
Copy link
Member

d4rken commented Nov 22, 2018

3 is a basic command shell, but 4 is a filereader that internally uses a root shell too.

7 is the actual loading of installed apps, 6 is actually part of 5, because to load running apps we also need to know the installed apps.

@d4rken
Copy link
Member

d4rken commented Nov 22, 2018

I think I can remove 4, by reusing 3's shell.

I'll have to look more into whether we can do 7 first, then reuse it in 5 and 6.

I've started on removing 4, but it's more complicated than I thought. Too exhausted for that now I want to release this beta. Pushing this to the next update 😅.

@d4rken
Copy link
Member

d4rken commented Nov 23, 2018

Eliminated 4 by reusing 3's shell.

Also eliminated 6 by ensuring 5 runs after 7. With 5 will reuse the cached data from step 7, so no extra shell will be launched.

7 -> 5 👍

The rest can't easily be eliminated without breaking seperation of concerns between the different parts of SD Maid. It would also get us into concurrency hell when multiple tools are running in parallel.

@d4rken d4rken closed this as completed Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants