-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
With PHP 8.1, preloading is expected to be of less relevancy so we're wondering about its usefulness.
Dropping support for it in Symfony would mainly mean to stop generating the var/cache/prod/App_KernelProdContainer.preload.php
file, which could remove some complexity in the DI component.
I've run a very simple benchmark on a minimal "Hello World" and I do see a performance improvement when enabling preloading.
This is with the php -S dev-server:
php8.2 -S localhost:8080 -t public/ 2>/dev/null -dopcache.preload=/app/config/preload.php
And with composer i -a
of course (optimized class-loader).
Here is the blackfire.io comparison:
https://blackfire.io/profiles/compare/5a25b32c-5027-4247-b9b3-721b3c456018/graph
So it looks like yes, not calling the autoloader does yield some perf boost.
While we might not recommand using preloading without care, it does have a use case apparently.
I'm opening this RFC to gather feedback on the topic and to keep some record of the decision about preloading.
What's your experience with it?