NEW 258808
Initialising many a/v players on Safari is done very inefficiently
https://bugs.webkit.org/show_bug.cgi?id=258808
Summary Initialising many a/v players on Safari is done very inefficiently
Derk-Jan Hartman
Reported Monday, July 3, 2023 3:01:30 PM UTC
This was initially noticed on https://en.wikivoyage.org/wiki/Portuguese_phrasebook with Safari 16.5.1 This page has 440 audio players. Even if we disable all JS for this page, this page is incredibly slow to load in Safari (some 20 or so seconds). When loading the same page in FF or Chrome it loads within 3 seconds (even with JS enabled). I have pinpointed this to the initialisation of the audio players on this page. Analysing the behaviour, it seems that the page uses 1 single callback to initialise the UI for all the players on the page but does so dynamically based on the available space and it seems to do some sort x ** n measuring. I've filed this under Page loading instead of media, because of the serious effect on the loading phase.
Attachments
Alexey Proskuryakov
Comment 1 Monday, July 3, 2023 11:23:02 PM UTC
Yes, this wikipedia page is very slow to load and to scroll. It spends half of the time in layout trying to figure out if layers want to composite, and another half in JavaScript code under ensureMediaControls(), notably in a callout to WebCore::jsMediaControlsHostPrototypeFunction_base64StringForIconNameAndType(). I think that I've seen an earlier bug about slowness loading a page with many audio elements, but I cannot find it now.
Radar WebKit Bug Importer
Comment 2 Wednesday, July 5, 2023 4:02:10 PM UTC
Note You need to log in before you can comment on or make changes to this bug.