Page MenuHomePhabricator

Beta player slow at loading many videos in Firefox
Open, NormalPublic

Description

When viewing a page with a lot of videos, e.g. https://commons.wikimedia.org/wiki/Category:Videos, it takes a long time to load. Enough so that Firefox suggests stopping the page loading because it's slowing the browser. The same page loads fine with the non-beta player.

This happens in Firefox 67.0.2.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 24 2019, 9:01 AM
TheDJ triaged this task as Normal priority.Jun 24 2019, 9:50 AM

Confirming. Using https://commons.wikimedia.org/wiki/Category:Videos?debug=true :

It transfers a large webm file while I only expect a small thumbnail file?

brion claimed this task.Jun 24 2019, 10:27 AM
brion added a subscriber: brion.

Probably should adjust the preload setting; ISTR some related issue in past. Will test further once no longer encountering unrelated server errors.

TheDJ added a subscriber: TheDJ.Jun 24 2019, 6:20 PM

Actually its also pretty slow if you completely disable the JS player. Were doing inline video now, im wondering if the render is a lot more expensive now (and not cached due to beta ?)

TheDJ added a comment.Jul 4 2019, 9:59 AM

@Aklapper's results are strange.. All video elements are hinted not to preload.. All JS instantiations on pages with more than 10 videos are also hinted NOT to preload. As such entire downloads really shouldn't be possible.. Maybe Chrome is being too smart for it's own good.

We can likely improve performance of JS initialisation a bit by breaking up the collections .each iterator, to make use of setTimeout/requestAnimationFrame, so that not everything happens in the same execution cycle. Does seems as if Safari is particularly slow when it has many <video> elements however...

We probably should also profile a page like this on the PHP side.. It's just a bit difficult to reproduce a Category page like that locally in order to run that profiling....