Page MenuHomePhabricator

Performance decreased saving pages for sites with non-alphabetical code interwiki sort (interwiki_putfirst specified)
Closed, ResolvedPublic

Description

When running interwiki.py, when changes are needed to a wiki which has a non-default interwiki sort order (site.interwiki_putfirst() has value), the process hangs for some (around 10) seconds.

After fiddling around, I found the bottleneck to be at textlib.py function **def interwikiSort(sites, insite=None)**.
Specifically, there's a loop in which **insite.validLanguageLinks()** is constantly evaluated (even though it's always the same), and is responsible for most of the time the loop takes. The result of this function should be cached outside the loop.

Details

Related Gerrit Patches:

Event Timeline

Malafaya created this task.Aug 14 2015, 3:37 PM
Malafaya raised the priority of this task from to Medium.
Malafaya updated the task description. (Show Details)
Malafaya added a subscriber: Malafaya.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptAug 14 2015, 3:37 PM

Change 231577 had a related patch set uploaded (by Malafaya):
T109077 Performance decreased saving pages for sites with non-alphabetical code interwiki sort (interwiki_putfirst specified)

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

Malafaya claimed this task.Aug 14 2015, 4:16 PM

Change 231577 merged by jenkins-bot:
T109077 Performance decreased saving pages for sites with non-alphabetical code interwiki sort (interwiki_putfirst specified)

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

Xqt closed this task as Resolved.Aug 14 2015, 5:33 PM
Xqt added a subscriber: Xqt.

Change 243114 had a related patch set uploaded (by John Vandenberg):
T109077 Performance decreased saving pages for sites with non-alphabetical code interwiki sort (interwiki_putfirst specified)

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

Change 243114 had a related patch set uploaded (by John Vandenberg):
Performance fix for sites using interwiki_putfirst option

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

Change 243114 merged by jenkins-bot:
Performance fix for sites using interwiki_putfirst option

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