Skip to content

symfony/ux-css slow on big array shape #15348

Description

@staabm

Bug report

The array shape that symfony/ux-css generates for its css() Twig function has about 840 keys, 126 of them referring to a nested shape, and checking one method parameter against it took seconds.

reproducer in https://github.com/Kocal/sf-ux-css-phpstan-reproducer

running the reproducer on PHPStan 2.2.16:

➜  sf-ux-css-phpstan-reproducer git:(main) ✗ vendor/bin/phpstan analyse -c phpstan-nested.neon --debug -vv
Result cache not used because of debug mode.
/Users/staabm/workspace/sf-ux-css-phpstan-reproducer/src/Ui/Button.php
Result cache is saved.
                                                                                                                        
 [OK] No errors                                                                                                                                                                                                                                 

Elapsed time: 31.34 seconds
Peak memory: 78 MB

running the reproducer on PHPStan 2.3.x@bee10c5:

➜  sf-ux-css-phpstan-reproducer git:(main) ✗ vendor/bin/phpstan analyse -c phpstan-nested.neon --debug -vv 
Result cache not used because of debug mode.
/Users/staabm/workspace/sf-ux-css-phpstan-reproducer/src/Ui/Button.php
Result cache is saved.
                                                                                                                        
 [OK] No errors                                                                                                                                                                                              

Elapsed time: 4.76 seconds
Peak memory: 54 MB

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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