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

Remove optimize-autoloader #16

Merged
merged 2 commits into from
Jan 31, 2023
Merged

Conversation

bencroker
Copy link
Contributor

This PR removes the optimize-autoloader config option from the composer.json files, since according to the Composer docs:

By default, the Composer autoloader runs relatively fast. However, due to the way PSR-4 and PSR-0 autoloading rules are set up, it needs to check the filesystem before resolving a classname conclusively. This slows things down quite a bit, but it is convenient in development environments because when you add a new class it can immediately be discovered/used without having to rebuild the autoloader configuration.

And:

You should not enable any of these optimizations in development as they all will cause various problems when adding/removing classes. The performance gains are not worth the trouble in a development setting.

Source: https://getcomposer.org/doc/articles/autoloader-optimization.md#autoloader-optimization

Related discussion: craftcms/cms#12583

@khalwat
Copy link
Contributor

khalwat commented Jan 31, 2023

Good call!

@khalwat khalwat merged commit 77aa2f5 into nystudio107:develop Jan 31, 2023
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.

2 participants