Repository navigation
UtilityMethodTestCase: performance improvement - #525
Merged
Merged
Conversation
PR squizlabs/PHP_CodeSniffer 3831 / PHPCSStandards/PHP_CodeSniffer 61 in PHPCS itself makes a change to improve the performance of the `Config` class.
This commit lets the `UtilityMethodTestCase` take advantage of that performance improvement by explicitly passing the `report_width` to prevent a call to `shell_exec('stty ...')` from being made and slowing down the tests.
While not benchmarked properly, with the test runs for PHPCSUtils on my local machine on Windows, the difference this change makes is significant and noticable:
* Before: **2.5 minutes**.
* After: **1 second**.
This advantage can only be seen with PHPCS 3.8.0 or higher, but the change does not negatively impact test runs against PHPCS < 3.8.0, so there is no need to raise the minimum PHPCS version.
jrfnl
marked this pull request as ready for review
December 7, 2023 02:01
jrfnl
added a commit
to PHPCSStandards/PHPCSDevTools
that referenced
this pull request
Mar 4, 2024
PHPCSUtils 1.0.9 made a change to the `UtilityMethodTestCase` which causes the selected sniff to no longer register its token listeners as the `installed_paths` from the `CodeSniffer.conf` file are no longer read out. While this is fine for actual utility methods, it breaks the tests for the `PHPCSDebug.Debug.TokenList` test. Fixed now. Refs: * https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.9 * PHPCSStandards/PHPCSUtils#525
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR squizlabs/PHP_CodeSniffer#3831 / PHPCSStandards/PHP_CodeSniffer#61 in PHPCS itself makes a change to improve the performance of the
Configclass.This commit lets the
UtilityMethodTestCasetake advantage of that performance improvement by explicitly passing thereport_widthto prevent a call toshell_exec('stty ...')from being made and slowing down the tests.While not benchmarked properly, with the test runs for PHPCSUtils on my local machine on Windows, the difference this change makes is significant and noticable:
This advantage can only be seen with PHPCS 3.8.0 or higher, but the change does not negatively impact test runs against PHPCS < 3.8.0, so there is no need to raise the minimum PHPCS version.