?
avatar Bakual
Bakual
27 Jun 2017

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?

avatar Bakual Bakual - open - 27 Jun 2017
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jun 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Jun 2017
avatar mbabker
mbabker - comment - 27 Jun 2017

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 and autoload_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.

avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Jun 2017
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Jun 2017
Category Administration
avatar laoneo
laoneo - comment - 28 Jun 2017

As we have only external packages loaded trough composer, guess it will be worth a try to run it in optimized mode.

avatar Bakual
Bakual - comment - 28 Jun 2017

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.

avatar laoneo
laoneo - comment - 28 Jun 2017

I was playing around with it and it creates bigger classmap files. Created a pr for it #16896. I think it is worth to enable it, even tough in staging the impact will be little, but in J4, where we have more libs installed, we will get some improvements.

avatar zero-24 zero-24 - change - 28 Jun 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-06-28 13:39:14
Closed_By zero-24
avatar zero-24 zero-24 - close - 28 Jun 2017
avatar zero-24
zero-24 - comment - 28 Jun 2017

Closing as we have a PR :)

Add a Comment

Login with GitHub to post a comment