Checks are much slower with (some?) SlevomatCodingStandard rules
ocean90 opened this issue · comments
Example file: inc/Blocks/namespace.php
With current rules:
$ phpcs inc/Blocks/namespace.php
Time: 11.11 secs; Memory: 12MB
Without any SlevomatCodingStandard rules:
$ phpcs inc/Blocks/namespace.php
Time: 511ms; Memory: 12MB
This is also noticeable in VS Code where checks are delayed and two PHP processes constantly running with high CPU usage.
I can copy that.
Example in 💩 code with current rules.
phpcs includes/models/JobModel.php
Time: 13.38 secs; Memory: 14MB
Without any SlevomatCodingStandard rules (same file):
phpcs includes/models/JobModel.php
Time: 770ms; Memory: 14MB
I've identified 2 rules which are causing this.
<!-- All references to types named Exception or ending with Exception must be referenced via a fully qualified name. -->
<!-- 5 - 6 seconds -->
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions"/>
<!-- Looks for unused imports from other namespaces. -->
<!-- 6 - 7 seconds -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
Same code, without this 2 rules:
> phpcs includes/models/JobModel.php --no-cache
Time: 716ms; Memory: 12MB
Danke, war bei mir auch zu und habe dann kurzen Prozess gemacht und die beiden Regeln erstmal deaktiviert.
Upstream issue: slevomat/coding-standard#929
The file inc/Blocks/namespace.php
is private ¯_(ツ)_/¯
@kukulich Happy to share the file with you. What's you email address? Or feel free to drop me a line dominik(at)required.com.
The slow sniffs have been fixed so we can re-add them once 6.2.0 is available.