Perf/reorganize autoloading - #62231
Conversation
|
(I'm very hesitant about this approach but don't really know how to formulate my reasoning, but leaving a note for a soft-disagreement until I can better word things or change my mind) |
Is your disagreement with the PhpDumpCache API or the autoloader change? I did the PhpDumpCache part that way because I would like to re-use it for other things, notably caching commands as in this draft: #61865 |
This leverages opcache to be as fast as possible. Can be used for autoloading class maps, but also for other kind of pre-computed cached arrays (routes, occ commands, …). Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
The idea is to cache to disk a static classmap with all classes from core and applications. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
cachedirectory still needs to be added to config.sample.php Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
There was a weird inconsistent mix of Test\, Tests\lib, Test\Core, Tests\Core and Core\. Now there is only Test\ for tests/lib/ and Tests\Core for tests/Core. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
cdca333 to
b688559
Compare
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Avoids parsing info.xml from each app and recomputing namespaces. For now Autoloader still has its own calls to PhpDumpCache which is a bit dirty, we might want to clean that up later. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…mmmands This saves 100ms on occ runs by avoiding to load all commands to only run one of them. The list of commands is cached and loading is skipped when command is known. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Summary
The idea here is to have only one autoloader instead of one by application, with a cached classmap in a PHP file.
On a test instance (debug mode on) I get 500ms instead of 600ms to run
occ status.The cached array in PHP file mechanism could be leveraged for other optimizations.
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)