Skip to content

Codesniffer slow when Xdebug is enabled #3337

Description

@jansor

I don't know if this is an issue under Code Sniffer or Xdebug, but when i run code sniffers latest version with Xdebug enabled,
if becomes very slow, until even the point that its nor working anymore. i saw in previous comments/ reports that PHPCS is not using xdebug. But never the less when xdebug is toggled its a difference

OS is windows 10 Pro in combination with IIS:
I have upgraded PHP NTS from 8.0.3 to 8.0.6 same behavior
I have tested with xdebug 3.0.3 and also 3.0.4(latest version)

When switching between Code sniffer 3.6.0 and the previous version 3.5.8 its makes a massive difference on execution time, this is when xdebug is enabled.
I have 1435 classes, and files to process and when cache turned off it takes around: Time: 3 mins, 24 secs; Memory: 438MB

But when I run the same set under 3.6.0 then I never been able to finish yet (again when xdebug is enabled).
If I disable xdebug, then 3.6.0 is working fine.

I don't know if someone have the same issue, or can replicate this problem? Again, its possible that the issue is xdebug related, but i only experience it with PHPCS.

PHPCS CLI

php phpcs.phar --standard=PSR12 -d memory_limit=128M --ignore-annotations --no-cache --no-colors --parallel=4 --report=full -p src

Xdebug config from the php.ini file

; XDEBUG may only be loaded on the development servers and are used to get more information regarding exceptions and errors that happen.
[PHP_XDEBUG]
zend_extension = xdebug

; Additional configuration for some of the extensions
[xdebug]
xdebug.mode = develop
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.scream = 0
xdebug.force_error_reporting = 1
xdebug.force_display_errors = 1
xdebug.output_dir = "D:\Inetpub\logs\xdebug\"
; Enable profiler to analyses slow pages
;xdebug.mode = profile
xdebug.profiler_output_name = "callgrind.out.%H_%R.%u"
; Enable trace system for memory
; xdebug.mode=trace
xdebug.trace_output_name = "trace.out.%u.%H_%R"

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