Page MenuHomePhabricator

Special:Version with exts in git is too slow, needs caching or using something other than git show
Closed, ResolvedPublic

Description

Special:Version on labs requires digging out the info from git for each extension, this comes down to git show on each extension, which takes far too long. Either information should be cached and we should be clever about how we check that the cached info for an ext is no longer valid, or we should get the info for multiple repos in a batch, instead of shelling out separately for each one.

Representative is this output: Served by deployment-apache33 in 28.877 secs. See http://en.wikipedia.beta.wmflabs.org/wiki/Special:Version to test for yourselves.


Version: 1.22.0
Severity: normal
See Also:
T49265: Option to disable showing dates of git commits in Special:Version

Details

Reference
bz51360

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:57 AM
bzimport set Reference to bz51360.
bzimport added a subscriber: Unknown Object (MLST).

The code in Special:Version does look for the HEAD sha1 (which first read .git/HEAD then if it is a ref load .git/refs/origin/master to get the actual sha1).

Then we look for the commit date with getHeadCommitDate() which shells out. What could be done is to cache the commit date in memcached with a key like git-sha1-date-<the sha1 there>. That would prevent the shell outs though still requires a bunch of stats() /file reads.

The code is also duplicated in getCreditsForExtension() and thus need to be updated there as well.

Krinkle claimed this task.