Page MenuHomePhabricator

[Story] Reduce initialisation time of SiteLinks
Closed, ResolvedPublic

Description

We would like to reduce initialization time of SiteLinks and it's sub widgets as it is a main cause of the total render time according to T125502: [Task] Investigate time spent for initialization of individual widgets

Event Timeline

Jonas raised the priority of this task from to High.
Jonas updated the task description. (Show Details)

We found that the _shortenPageName function in sitelinkview.js is one of the most time consuming details on the page now. For testing, here is one of the longest page titles on the live site: https://www.wikidata.org/wiki/Q229568

Change 271753 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Never shorten page titles in sitelinks below 15 characters

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

Change 272475 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Use binary search in sitelinkview._shortenPageName

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

@Lydia_Pintscher We should talk about this today, unless you already know what you want.

Change 272625 had a related patch set uploaded (by Adrian Heine):
Make long site links wrap nicely

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

Two versions of site id positioning:

Screenshot from 2016-02-23 10-51-18.png (1×1 px, 236 KB)

Screenshot from 2016-02-23 10-51-53.png (1×1 px, 236 KB)

Long words are an issue. I see three straight-forward workarounds. @Lydia_Pintscher @Incabell

Limit leakage to length of site id:

Screenshot from 2016-02-23 12-27-51.png (1×1 px, 239 KB)

Break words wherever you want to:

Screenshot from 2016-02-23 12-28-11.png (1×1 px, 238 KB)

Add scrollbar:

Screenshot from 2016-02-23 12-28-32.png (1×1 px, 235 KB)

Option one and three are clearnly no-gos. Let's go with 2.

Current patch revision does good things: In chromium, it breaks on whitespace where possible, long words just randomly. In Firefox, it adds hyphens. Reviewers, please check in your browsers.

Change 272625 had a related patch set uploaded (by Adrian Heine):
Make long site links wrap nicely

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

@thiemowmde Do you consider this done or should we wait for T124786?

I linked T124786 so it doesn't get lost so easily, but I agree we can and should close this here for now.

Change 272625 merged by jenkins-bot:
Make long site links wrap nicely

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

Change 271753 abandoned by Thiemo Mättig (WMDE):
Never shorten page titles in sitelinks below 15 characters

Reason:
I4a26042 is merged, code does not exist any more.

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

Change 272475 abandoned by Thiemo Mättig (WMDE):
Use binary search in sitelinkview._shortenPageName

Reason:
I4a26042 is merged, code does not exist any more.

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

adrianheine moved this task from Backlog to Done on the Wikidata-Sprint-2016-02-16 board.