Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible performance issue with version 2.0.4 #146

Closed
pacproduct opened this issue Feb 23, 2022 · 7 comments
Closed

Possible performance issue with version 2.0.4 #146

pacproduct opened this issue Feb 23, 2022 · 7 comments

Comments

@pacproduct
Copy link

Hi :)

We're using FriendsOfPHP/PHP-CS-Fixer version 3.0.4 which relies on this package composer/xdebug-handler in version 2.

Since the recent upgrade from xdebug-handler version 2.0.3 to 2.0.4, PHP-CS-Fixer seems to be suffering from an important performance drop.

More details and procedure to reproduce the issue on the ticket I opened on their repository: PHP-CS-Fixer/PHP-CS-Fixer#6310

@johnstevenson
Copy link
Member

Have you run it with XDEBUG_HANDLER_DEBUG=1, as per https://github.com/composer/xdebug-handler#troubleshooting

It might help to troubleshoot things.

@pacproduct
Copy link
Author

@johnstevenson I just did, here are results:

  • With xdebug-handler 2.0.4 :
      hydrop@8c4678f103e8:/tmp/demo$ XDEBUG_HANDLER_DEBUG=1 tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src
      xdebug-handler[632] Checking PHP_CS_FIXER_ALLOW_XDEBUG
      xdebug-handler[632] The Xdebug extension is loaded (2.7.0RC2)
      xdebug-handler[632] No restart (PHP_CS_FIXER_ALLOW_XDEBUG=) Allowed by application
      Loaded config default from "/tmp/demo/.php-cs-fixer.dist.php".
      Paths from configuration file have been overridden by paths provided as command arguments.
    
      Fixed all files in 18.148 seconds, 6.000 MB memory used
  • With xdebug-handler 2.0.3 :
      hydrop@8c4678f103e8:/tmp/demo$ XDEBUG_HANDLER_DEBUG=1 tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src
      xdebug-handler[670] Checking PHP_CS_FIXER_ALLOW_XDEBUG
      xdebug-handler[670] The Xdebug extension is loaded (2.7.0RC2)
      xdebug-handler[670] Process restarting (PHP_CS_FIXER_ALLOW_XDEBUG=internal|2.7.0RC2|1|*|*)
      xdebug-handler[670] Running /usr/bin/php7.3 -n -c /tmp/7VvtyF tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src
      xdebug-handler[672] Checking PHP_CS_FIXER_ALLOW_XDEBUG
      xdebug-handler[672] Restarted (37 ms). The Xdebug extension is not loaded
      Loaded config default from "/tmp/demo/.php-cs-fixer.dist.php".
      Paths from configuration file have been overridden by paths provided as command arguments.
    
      Fixed all files in 0.954 seconds, 14.000 MB memory used
      xdebug-handler[670] Restarted process exited 0

@SpacePossum
Copy link

xdebug-handler[632] No restart (PHP_CS_FIXER_ALLOW_XDEBUG=) Allowed by application

hmm do we have to set PHP_CS_FIXER_ALLOW_XDEBUG in the application itself somewhere?

@johnstevenson
Copy link
Member

Yup it's a bug. You can get around it by running a version of xdebug 3 until I've fixed this.

@johnstevenson
Copy link
Member

Fixed in releases 2.0.5 and 3.0.2. Thanks for the catch.

@SpacePossum
Copy link

thanks @johnstevenson !

SpacePossum added a commit to PHP-CS-Fixer/PHP-CS-Fixer that referenced this issue Mar 7, 2022
This PR was squashed before being merged into the master branch (closes #6316).

Discussion
----------

bump xdebug-handler

Closes #6310
see also composer/xdebug-handler#146 for details
thanks @pacproduct

Commits
-------

77d936a bump xdebug-handler
@pacproduct
Copy link
Author

@johnstevenson I can confirm version 2.0.5 does fix our issue. Many thanks for the prompt fix! :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants