Honestly I have no clue if we do that already or not or if it is even something we should or could do.
I just stumbled over the composer option optimize-autoloader
(see https://getcomposer.org/doc/articles/autoloader-optimization.md). According to that doc this option should be activated for production enviroments as it speeds things up quite a bit.
What do you composer savvy guys think?
Labels |
Added:
?
|
Status | New | ⇒ | Discussion |
Category | ⇒ | Administration |
As we have only external packages loaded trough composer, guess it will be worth a try to run it in optimized mode.
From https://getcomposer.org/doc/articles/autoloader-optimization.md#trade-offs:
There are no real trade-offs with this method. It should always be enabled in production.
So from what I understand, Level 1 optimisation should be done as there is no reason not to do it. Level 2 is another topic and doesn't look like suitable for us.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-28 13:39:14 |
Closed_By | ⇒ | zero-24 |
Closing as we have a PR :)
It might be better off in 4.0 than 3.x. Honestly the only difference it makes as it relates to code is it adds each class individually to the class maps in Composer's
autoload_classmap.php
andautoload_static.php
files, so when PHP has to get into the autoloader Composer will check that map first then fall back into scanning the filesystem based on the namespace. So for our uses right now, the performance gain is probably negligible, but in a proper Symfony or Laravel based project which is entirely Composer driven it can make a world of difference.