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

[1.x] Speeds up CLI and tests by enabling OpCache #569

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

lukeraymonddowning
Copy link
Contributor

Hi all,

So I've been toying around with eeking out further performance when running tests. I notice that in Sail, OpCache is enabled with validate_timestamps set to 1 and revalidate_freq set to 0 so that changes are applied immediately. However, enable_cli is disabled (as is the default for OpCache).

By enabling this flag, we can significantly improve the time is takes to execute tests inside Sail. On a project running L10, Pest v2 with parallel enabled, I was able to reduce the time to run the test suite from 51s to 42s, ~20% improvement. No other changes were made.

Thanks as always for all the hard work.

Kind Regards,
Luke

@github-advanced-security
Copy link

You have successfully added a new shellcheck configuration differential-shellcheck. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@taylorotwell taylorotwell merged commit 5e59b4a into laravel:1.x Mar 30, 2023
@francoism90
Copy link
Contributor

If I'm not mistaken PHP didn't recommend enabling Opcache for CLI in the past, but this seems to be changed: https://stackoverflow.com/questions/25044817/zend-opcache-opcache-enable-cli-1-or-0-what-does-it-do

I could not find why they removed the warning, maybe more Opcache settings should be tweaked for this to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants