AdguardTeam / AdguardTeam/AdGuardMiniForMac
On-demand launching
- Dominant language
- Swift
- Stars
- 1.2k
- Forks
- 83
- PR merge metrics
- PR metrics pending
Description
### Suggestion Description
Adguard for Safari has surprisingly high memory usage when the app is running, well over 300mb on my macOS 10.15.6 system, which is high for what it does.
This becomes an even bigger problem with multiple user-accounts, each with adblocking enabled, as if AdGuard for Safari is configured to launch at login the RAM usage adds up quickly; it will only two three logged in users to consume over a gigabyte of RAM. My understanding that this may be partly down to the use of some intermediate framework (Electron?). Anything that makes development easier is of course great, but I feel like there must be a way to reduce the typical memory usage.
### Proposed Solution
My understanding of the Safari content blocker API is that the app isn't actually necessary once rules have been set, except to update those rules, so it shouldn't matter if the app isn't running 24/7.
So in the short term, the easiest solution would be to somehow launch the main app only when necessary, i.e- when once a day to check for filter updates, or when the user wants to change settings. While this wouldn't actually reduce the app's memory usage when running, it would only consume that memory temporarily while open, closing again at the earliest opportunity.
This would require some changes to the button in Safari to remove the assumption that the app will always be running, i.e- to offer all options anyway, and to try to launch the app to handle them if/when necessary.
I will however freely admit that I'm very unfamiliar with how Safari extensions work and what capabilities that developers have/do not have, if anyone can clarify any issues that might arise then we might be able to find a way around them. I know that extensions can launch their associated app, so the question is whether an extension app has a way to schedule itself to reopen periodically (can they install launch agents?)
### Alternatives Considered
The ideal solution would be to massively reduce RAM usage, though this would probably require a rewrite away from any frameworks currently being used, which would involve a lot of work; if the app can be adapted to run only when actually needed, then memory usage won't really be an issue, though it may be worth thinking about anyway.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.