Further refine Optimization Detective integration with build process and PL plugin#1082
Conversation
2964a91 to
9afee62
Compare
efbc82a to
b653d57
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| </rule> | ||
|
|
||
| <!-- Check up to 20 files simultaneously. --> | ||
| <arg name="parallel" value="20"/> |
There was a problem hiding this comment.
I think it should be moved to phpcs.ruleset.xml and removed from anywhere else.
There was a problem hiding this comment.
Without parallel execution
➜ performance git:(update/optimization-detective-merge) ✗ composer lint:all
> build-cs/vendor/bin/phpcs
............... 15 / 15 (100%)
Time: 541ms; Memory: 22MB
> build-cs/vendor/bin/phpcs '--' './plugins/auto-sizes' '--standard=./plugins/auto-sizes/phpcs.xml.dist'
.. 2 / 2 (100%)
Time: 88ms; Memory: 14MB
> build-cs/vendor/bin/phpcs '--' './plugins/dominant-color-images' '--standard=./plugins/dominant-color-images/phpcs.xml.dist'
..... 5 / 5 (100%)
Time: 176ms; Memory: 16MB
> build-cs/vendor/bin/phpcs '--' './plugins/embed-optimizer' '--standard=./plugins/embed-optimizer/phpcs.xml.dist'
.. 2 / 2 (100%)
Time: 96ms; Memory: 16MB
> build-cs/vendor/bin/phpcs '--' './plugins/optimization-detective' '--standard=./plugins/optimization-detective/phpcs.xml.dist'
............... 15 / 15 (100%)
Time: 488ms; Memory: 20MB
> build-cs/vendor/bin/phpcs '--' './plugins/speculation-rules' '--standard=./plugins/speculation-rules/phpcs.xml.dist'
..... 5 / 5 (100%)
Time: 167ms; Memory: 16MB
> build-cs/vendor/bin/phpcs '--' './plugins/webp-uploads' '--standard=./plugins/webp-uploads/phpcs.xml.dist'
...... 6 / 6 (100%)
Time: 288ms; Memory: 22MBWith parallel execution
➜ performance git:(update/optimization-detective-merge) ✗ composer lint:all
> build-cs/vendor/bin/phpcs
............... 15 / 15 (100%)
Time: 162ms; Memory: 12MB
> build-cs/vendor/bin/phpcs '--' './plugins/auto-sizes' '--standard=./plugins/auto-sizes/phpcs.xml.dist'
.. 2 / 2 (100%)
Time: 80ms; Memory: 12MB
> build-cs/vendor/bin/phpcs '--' './plugins/dominant-color-images' '--standard=./plugins/dominant-color-images/phpcs.xml.dist'
..... 5 / 5 (100%)
Time: 93ms; Memory: 12MB
> build-cs/vendor/bin/phpcs '--' './plugins/embed-optimizer' '--standard=./plugins/embed-optimizer/phpcs.xml.dist'
.. 2 / 2 (100%)
Time: 84ms; Memory: 12MB
> build-cs/vendor/bin/phpcs '--' './plugins/optimization-detective' '--standard=./plugins/optimization-detective/phpcs.xml.dist'
............... 15 / 15 (100%)
Time: 150ms; Memory: 12MB
> build-cs/vendor/bin/phpcs '--' './plugins/speculation-rules' '--standard=./plugins/speculation-rules/phpcs.xml.dist'
..... 5 / 5 (100%)
Time: 102ms; Memory: 12MB
> build-cs/vendor/bin/phpcs '--' './plugins/webp-uploads' '--standard=./plugins/webp-uploads/phpcs.xml.dist'
...... 6 / 6 (100%)
Time: 147ms; Memory: 12MBThere was a problem hiding this comment.
Oh right. That explains why I wasn't seeing a performance improvement since it wasn't in the shared ruleset.
| <rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> | ||
|
|
||
| <!-- Exclude built plugins and built assets in plugins. --> | ||
| <exclude-pattern>./build/*</exclude-pattern> |
There was a problem hiding this comment.
Nice. Should we also move node_modules and vendor here?
There was a problem hiding this comment.
I don't think so because those directories are exclusively in the root of the repo and aren't also in the plugin subdirectories.
There was a problem hiding this comment.
@felixarntz @westonruter This file serves no purpose at the root of the project. Should we move it to bin/phpcs, just like Webpack utils?
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Thanks @westonruter for the PR.
In detect.js can we reuse const { log, formats } = require( '../lib/logger' ); and remove the console related function?
Actually no because this is a standalone unbuilt ESM module used on the frontend, not a CommonJS module used in node CLI. |
Got it. |
This PR addresses non-blocking code review feedback from @felixarntz in #1079 (review).
parallelarg to PHPCS. I tested this and it doesn't seem to help here in Performance Lab. It may be due to the AMP plugin having many more PHP files being tested at once where it then makes an impact. I'm reverting in Further refine Optimization Detective integration with build process and PL plugin #1082.builddirectory, and update.gitignoreandphpcs.xml.distto ignore suchbuilddirectories rather than the specific files that reside in them.detection/detect.jsout of the subdirectory since it was the only file located now located there.