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
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Declined | None | T59765 Provide JavaScript hook | |||
Resolved | Lydia_Pintscher | T63131 Eliminate or reduce delay between selection of property and displaying of input fields when adding statements | |||
Resolved | None | T58090 Do not change targets to javascript:void(0); on JavaScript load for various "edit" links | |||
Invalid | None | T56098 [Epic][UI] Front-end performance: Improve loading time of items | |||
Resolved | None | T127067 [Story] Reduce initialisation time of SiteLinks | |||
Resolved | • adrianheine | T127305 [Task] Change ellipsis from JS to CSS | |||
Resolved | • adrianheine | T127816 [Task] Render SiteLink count server side | |||
Invalid | thiemowmde | T124786 [Task] Widgets should delegate isInitialValue calls as far as possible |
Event Timeline
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
Change 272475 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Use binary search in sitelinkview._shortenPageName
@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
Long words are an issue. I see three straight-forward workarounds. @Lydia_Pintscher @Incabell
Limit leakage to length of site id:
Break words wherever you want to:
Add scrollbar:
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
I linked T124786 so it doesn't get lost so easily, but I agree we can and should close this here for now.
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.
Change 272475 abandoned by Thiemo Mättig (WMDE):
Use binary search in sitelinkview._shortenPageName
Reason:
I4a26042 is merged, code does not exist any more.