Skip to content

Commit 2618aa1

Browse files
committed
Reporting: add note about caching vs Performance Report
Related to #306
1 parent a4584ed commit 2618aa1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wiki/Reporting.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ PHP_CodeSniffer can output a sniff performance report showing you which sniffs i
447447

448448
When the `--colors` option is enabled, sniffs which take more than twice the average run time per sniff will be displayed in orange and sniffs with a cumulative listener run time of more than three times the average run time per sniff will display in red.
449449

450+
> [!NOTE]
451+
> The Performance report will only be useful when run without using the cache as otherwise the cache functionality will interfer with accurately measuring the runtime of sniffs.
452+
> So make sure to always use the `--no-cache` feature when running Performance reports.
453+
450454
> [!NOTE]
451455
> Enabling the performance report, in and of itself will make a PHP_CodeSniffer run slower. This is nothing to worry about as the exact time taken for each sniff isn't that relevant, it's the relative time taken _in comparison to other sniffs_ which is the interesting part.
452456
@@ -456,7 +460,7 @@ When the `--colors` option is enabled, sniffs which take more than twice the ave
456460
457461
To print a performance report, use the `--report=performance` command line argument. The output will look like this:
458462

459-
$ phpcs --report=performance /path/to/code
463+
$ phpcs --report=performance /path/to/code --no-cache
460464

461465
PHP CODE SNIFFER SNIFF PERFORMANCE REPORT
462466
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)