Page MenuHomePhabricator

Composer autoloader is slow
Closed, ResolvedPublic

Description

We should file a bug upstream with composer about their autoloader being slow with some performance info we have from the cluster and Tim's analysis (https://github.com/wmde/WikidataBuilder/pull/32).

Event Timeline

Legoktm created this task.Dec 22 2014, 11:29 PM
Legoktm raised the priority of this task from to Needs Triage.
Legoktm updated the task description. (Show Details)
Legoktm added a subscriber: Legoktm.
Legoktm set Security to None.Dec 23 2014, 12:04 AM
Legoktm added a subscriber: tstarling.
Krinkle renamed this task from File upstream bug with composer about the autoloader being slow to Composer autoloader is slow.Jan 1 2015, 5:06 AM
Krinkle changed the task status from Open to Stalled.
Krinkle added a project: Upstream.

A possible fix for the MediaWiki specific use case proposed at https://github.com/composer/composer/pull/3610.

gerritbot added a subscriber: gerritbot.

Change 187151 had a related patch set uploaded (by Legoktm):
Use classmap-authoritative setting

https://gerrit.wikimedia.org/r/187151

Patch-For-Review

Change 187151 merged by jenkins-bot:
Use classmap-authoritative setting

https://gerrit.wikimedia.org/r/187151

Change 187181 had a related patch set uploaded (by Legoktm):
composer.json: Set classmap-authoritative: true

https://gerrit.wikimedia.org/r/187181

Patch-For-Review

Legoktm triaged this task as High priority.Jan 29 2015, 6:39 PM

Change 187656 had a related patch set uploaded (by Hashar):
Revert "Use classmap-authoritative setting"

https://gerrit.wikimedia.org/r/187656

Patch-For-Review

@Legoktm I am reverting the class map authoritative patch because that breaks scap on beta cluster:

deployment-bastion$ mwscript mergeMessageFileList.php --wiki=eowiki --list-file="/srv/mediawiki-staging/wmf-config/extension-list"

PHP Fatal error:  Call to undefined method Composer\Autoload\ClassLoader::setClassMapAuthoritative()
in /mnt/srv/mediawiki-staging/php-master/vendor/composer/autoload_real.php on line 41

Which breaks beta-scap-eqiad job.

Change 187656 merged by jenkins-bot:
Revert "Use classmap-authoritative setting"

https://gerrit.wikimedia.org/r/187656

@Legoktm I am reverting the class map authoritative patch because that breaks scap on beta cluster:

deployment-bastion$ mwscript mergeMessageFileList.php --wiki=eowiki --list-file="/srv/mediawiki-staging/wmf-config/extension-list"
PHP Fatal error:  Call to undefined method Composer\Autoload\ClassLoader::setClassMapAuthoritative()
in /mnt/srv/mediawiki-staging/php-master/vendor/composer/autoload_real.php on line 41

Which breaks beta-scap-eqiad job.

This is similar to T73629: integration/phpunit has an older composer/ClassLoader.php that doesn't understand psr-4. The Composer\Autoload\ClassLoader class is common to all Composer-managed vendor collections. Each vendor ships one but only the first one that is loaded is used by the PHP/HHVM runtime. In this case the version of the class from multiversion is being invoked. So multiversion needs to be rebuilt with the latest Composer before we can use this feature. When that hurdle is cleared I'm pretty sure we will need to update the version of the class from integration/phpunit.

Change 188393 had a related patch set uploaded (by Legoktm):
composer.json: Set classmap-authoritative: true

https://gerrit.wikimedia.org/r/188393

Patch-For-Review

Change 188398 had a related patch set uploaded (by Legoktm):
Rebuild composer autoloader to support classmap-authoritative setting

https://gerrit.wikimedia.org/r/188398

Patch-For-Review

Change 188398 merged by jenkins-bot:
Rebuild composer autoloader to support classmap-authoritative setting

https://gerrit.wikimedia.org/r/188398

Change 188393 merged by jenkins-bot:
composer.json: Set classmap-authoritative: true

https://gerrit.wikimedia.org/r/188393

@Legoktm Do you have a checklist somewhere of the various Composer ClassLoader classes that we need to be sure are up to date?

Are there any left that we need to fix before trying to set "classmap-authoritative": true again?

mediawiki/extensions/DonationInterface/vendor maybe?

mediawiki/extensions/DonationInterface/vendor maybe?

Submitted https://gerrit.wikimedia.org/r/#/c/202075/

Change 202126 had a related patch set uploaded (by Legoktm):
Set classmap-authoritative: true

https://gerrit.wikimedia.org/r/202126

Change 202126 merged by jenkins-bot:
Set classmap-authoritative: true

https://gerrit.wikimedia.org/r/202126

@Legoktm I think this is {{done}} now. Is there anything else left that you wanted to do?

Legoktm closed this task as Resolved.Apr 28 2015, 4:58 PM

Change 187181 merged by jenkins-bot:
composer.json: Set classmap-authoritative: true

https://gerrit.wikimedia.org/r/187181

bd808 moved this task from Untriaged to Done on the Librarization board.Jul 22 2015, 11:16 PM