From 1f0511102b96da168628f2db4f178752210e1e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 3 Sep 2026 14:49:36 +0200 Subject: [PATCH] fix: Revert to registering autoloading app by app while booting them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It appears that this change had a bad perf impact. My theory is that some app autoloaders are slow and with the previous change they were used for a larger part of the boot process. Autoloader performance should be investigated (and there is ongoing work) but for now let’s revert to the faster version. Signed-off-by: Côme Chilliet --- .../AppFramework/Bootstrap/Coordinator.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php index cf7c71500e0ef..13e2bc2985e8e 100644 --- a/lib/private/AppFramework/Bootstrap/Coordinator.php +++ b/lib/private/AppFramework/Bootstrap/Coordinator.php @@ -11,6 +11,7 @@ use OC\App\AppManager; use OC\Support\CrashReport\Registry; +use OCP\App\AppPathNotFoundException; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\QueryException; @@ -64,12 +65,21 @@ private function registerApps(array $appIds): void { if ($this->registrationContext === null) { $this->registrationContext = new RegistrationContext($this->logger); } - $this->eventLogger->start('bootstrap:register_app:autoloader', 'Setup autoloader for apps'); - $this->appManager->registerAppsAutoloading($appIds); - $this->eventLogger->end('bootstrap:register_app:autoloader'); $apps = []; foreach ($appIds as $appId) { $this->eventLogger->start("bootstrap:register_app:$appId", "Register $appId"); + $this->eventLogger->start("bootstrap:register_app:$appId:autoloader", "Setup autoloader for app $appId"); + try { + $path = $this->appManager->getAppPath($appId); + $this->appManager->registerAutoloading($appId, $path); + } catch (AppPathNotFoundException $e) { + $this->logger->info('Error during app loading: ' . $e->getMessage(), [ + 'exception' => $e, + 'app' => $appId, + ]); + continue; + } + $this->eventLogger->end("bootstrap:register_app:$appId:autoloader"); /* * Next we check if there is an application class, and it implements