Skip to content

SF7.2 --> SF7.3: deprecations make performances crash #2820

Closed
@Nayte91

Description

@Nayte91

Hello team,

When I update my project from 7.2 to 7.3 and SFUX on 2.20 (update: tried with 2.25, same song), in my dev env (PHP8.4, nothing else than symfony version changed), performances (response time, memory usage) explodes, event with multiple loadings:
From (7.2):
Total execution time: 801 ms
Symfony initialization: 130 ms
Peak memory usage: 48.50 MiB
Number of deprecation notices: 7
To (7.3):
Total execution time: 5562 ms
Symfony initialization: 358 ms
Peak memory usage: 180.50 MiB
Number of deprecation notices: 7486

I was forced to raise my memory_limit to display page, and take those informations from profiler. Then I followed the path to discover that my Live Component call explodes the perfs. If I mute it, numbers come back to sanity:
Total execution time: 275 ms
Symfony initialization: 117 ms
Peak memory usage: 38.50 MiB
Number of deprecation notices: 218

Obviously, somehow the deprecation notices explodes and drown the perfs. My LiveComponent class is quite simple (I have some methods but removing them doesn't change perfs):

#[AsLiveComponent(template: 'molecules/replay/replay_row.html.twig')]
class ReplayRow extends AbstractController
{
    use DefaultActionTrait;

    #[LiveProp(writable: false)]
    public ReplayDTO $replay;
}

If I take a look at the deprecation notices, SF7.3 raises a lot of new ones. Here some examples I gather easily:

  • User Deprecated: Since symfony/property-info 7.3: The "Symfony\Component\PropertyInfo\Extractor\ConstructorExtractor::getTypes()" method is deprecated, use "Symfony\Component\PropertyInfo\Extractor\ConstructorExtractor::getType()" instead.
  • User Deprecated: Since symfony/property-info 7.3: The "Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor::getTypesFromConstructor()" method is deprecated, use "Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor::getTypeFromConstructor()" instead.
  • User Deprecated: Since symfony/property-info 7.3: The "Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor::getTypesFromConstructor()" method is deprecated, use "Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor::getTypeFromConstructor()" instead.
  • User Deprecated: Since symfony/property-info 7.3: The "Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor::getTypesFromConstructor()" method is deprecated, use "Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor::getTypeFromConstructor()" instead.
  • User Deprecated: Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.
  • User Deprecated: Since symfony/property-info 7.3: The "Symfony\Component\PropertyInfo\Type" class is deprecated. Use "Symfony\Component\TypeInfo\Type" class from "symfony/type-info" instead.

Seems like a pattern! Do you have an idea on how to snipe the change that can cause this? Do you also experienced such a raise?

If I change, in LiveComponentMetadataFactoryL87 the getTypes() to getType(), it falls to 218 deprecations, saving a lot. I can propose a PR with this, but I'm not aware of potential side effects!

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