Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UtilityMethodTestCase: performance improvement #525

Merged
merged 1 commit into from
Dec 7, 2023

Commits on Dec 7, 2023

  1. UtilityMethodTestCase: performance improvement

    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 committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    9e0ef95 View commit details
    Browse the repository at this point in the history