-
Notifications
You must be signed in to change notification settings - Fork 2
PRESS7-21: Optimize Composer autoloading #76
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @bradp, based on the screenshots you provided, it looks like setting "apcu-autoloader": true
in composer.json
significantly increased execution time:
autoload_real.php
: 0.014s → 0.333s (~22x increase)ClassLoader.php
: 0.078s → 0.186s (~2.4x increase)
We might want to double-check if APCu is actually helping in this case or if it’s introducing unnecessary overhead. Let me know if I’m missing something. Thanks!
The first screenshots are on my local, and you are correct; there was a decrease. However, take a look at the last 2 screenshots - those are on a Bluehost site and showed a pretty drastic improvement, both |
@bradp - Can we get the total load times for before and after this change on a bluehost production site? Broken down is nice too, but hard to tell a full picture with just the screenshots since some of them are cropped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran a few tests on a BH prod site, but I couldn't find a clear pattern indicating that this consistently reduces load time on the site. For example, in some cases, the load time actually increases, while in others, it decreases. But, I can't find a consistent trend nor a large change when I compare same files.
We could consider getting help from QA to write an automation script that runs n samples or so on a prod site to see if we can identify a trend.
Proposed changes
Configures Composer to use APCu cache optimization for the autoloader.
On my local install the improvements were good but not amazing.
Before the change:

After the change:

For reference, using Authoritative class maps showed a small improvement, but not as much as APCu cache

However, on a Bluehost site the improvements are quite striking. The autolo
Before the change:

After the change:
