A sheer amount of time is spent at each request to load files to run them.
Since PHP 7.4, there is a PHP mechanism called preloading that will load files at php-fpm (php application server) start and never load them again.
This has an impact on the memory (because the loaded files are permanently there) as well as with attempt to do hacky stuff on target server (once a file is preloaded, you must restart php-fpm to reload it).
The performance impact is neverthless interesting. On a dev server (composer prod mode, no xdebug, sessions in redis), mesured with blackfire:
- HomePage:
- Reference: 114ms
- Preload of Core: 92.9ms (-19%)
- One Artifact:
- Reference: 345ms
- Preload of Core: 278ms (-19%)
- On tracker report with ~15 artifacts:
- Reference: 288ms
- Preload of Core: 253ms (-12%)
- REST milestones Route:
- Reference: 305ms
- Preload of Core: 233ms (-23%)
Preload of core means:
- most of
src/common
- cherry-picked parts of
src/vendor
The figures with Core are already quite interesting, esp. when dealing with pages and resources in plugins (more benefit can be expected with preloading of plugins)