Make individual app boot methods more lazy
Open
@juliusknorr is already working on this.
Since May 14, 2024.
1. to develop
enhancement
feature: apps management
performance 🚀
technical debt
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
While looking at some flamegraphs I noticed that we still have plenty of apps that have logic in the boot method that could be done far more lazy. Those would trigger larger chunks of dependency injection pulling in class instances that might not be needed (yet). While some dependencies might still be pulled in later there is definitiely potential for saving some load in the app boot process.
While every change itself might be rather small, this could add up in total to become a nice improvement.
A few examples that could be beneficial to move:
- Mount provider registration (files_sharing, files_external, groupfolders, collectives, ...)
- https://github.com/nextcloud/server/pull/45953
- groupfolders
- collectives
- circles
- files_external
- Some apps like files_sharing still register events in a non-lazy way
- dav app hook manager pulls in lots of dependencies (https://github.com/nextcloud/server/blob/443b26761ddb80e8724b4eab1076f349cf62f6fd/apps/dav/lib/AppInfo/Application.php#L222)
- Federation providers with addCloudFederationProvider (spreed, federatedfilesharing)
- Legacy resource provider (deck/talk) is not done fully lazy
- Share provider registration requires to setup the ShareManager (currently only relevant for deck as talk is hard coded in server)
- Comments event handler registration requires to pull in ICommentsManager https://github.com/nextcloud/server/blob/aa5f037af71c915424c6dcfd5ad2dc82797dc0d6/apps/comments/lib/AppInfo/Application.php#L86
- Legacy ISearch provider registration (could be dropped)
- files_lock registering lock provider (while ILockManager is free of dependencies, LockProvider has quite some that might be not needed on every request)
- Register template creators (text/richdocuments/onlyoffice)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.