Skip to content

[RFC] Drop support for generating preloading script #50969

@nicolas-grekas

Description

@nicolas-grekas

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

image

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions