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

Unload UI when it's not in use, to reduce the performance impact even further #328

Open
Tyrrrz opened this issue Aug 6, 2024 · 1 comment

Comments

@Tyrrrz
Copy link
Owner

Tyrrrz commented Aug 6, 2024

As a result of the discussion that took place in #273, it became apparent that the biggest culprit in LightBulb's passive CPU/RAM consumption is the GUI rendering loop, which is active even when the application is hidden to tray. To deal with that, we can try to detach the UI from the core gamma manipulation loop and only load the UI (and the associated resources) when needed.

Ideally, we should try to achieve this within a single process. Would need to investigate if Avalonia supports shutting down the application without exiting the process. If so, we may be able to shut down and re-start multiple application lifetimes within a single process lifetime, which should do the trick.

Worst case scenario, we would have to split the application into two separate processes (headless backend and on-demand frontend) and figure out a way to make them communicate with each other. This is possible, but significantly more difficult.

@e-t-l
Copy link

e-t-l commented Sep 8, 2024

two separate processes (headless backend and on-demand frontend) and figure out a way to make them communicate with each other. This is possible, but significantly more difficult

Granted, I have zero familiarity with Avalonia, but I suspect that two separate processes will ultimately be much simpler, both to create and to maintain/update. There are tons of applications that have multiple processes, and Inter-Process Communications are not a new concept. I guarantee You may even want the frontend to be a child process of the backend, since the backend should be persistent anyway.

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