8000 Container building performance with lazy autowire error messages · Issue #32711 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Container building performance with lazy autowire error messages #32711
Closed
@bsod85

Description

@bsod85

Symfony version(s) affected: 4.3.*

Description
Performance of container building has been degraded after 4.3 update

How to reproduce
https://github.com/bsod85/sf_autowire_performance
By switching the symfony/dependency-injection between 4.2.* and 4.3.*, after a composer update I obtain these results with the command "time bin/console cache:clear":
Version 4.3 -> 107,57s user 0,49s system 99% cpu 1:48,07 total
Version 4.2 -> 24,77s user 0,45s system 99% cpu 25,233 total

Additional context
After a bisect I came to the conclusion that the problem has been introduced in commit 3b3a1bd
The AutowirePass::createTypeNotFouldMessageCallback() method creates a new copy of the entire container for each encountered error.
This severely hinders the performance on big projects if many non-autowirable classes are processed by the "resource" option.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0