Bug 245133 - Asynchronously load CSS causes extremely slow performance
Summary: Asynchronously load CSS causes extremely slow performance
Status: RESOLVED DUPLICATE of bug 244879
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-13 05:36 PDT by mic.gallego
Modified: 2022-09-15 09:35 PDT (History)
6 users (show)

See Also:


Attachments
High CPU usage (213.36 KB, image/png)
2022-09-13 05:36 PDT, mic.gallego
no flags Details
Without asynchronous loading trick (160.72 KB, image/png)
2022-09-13 05:36 PDT, mic.gallego
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mic.gallego 2022-09-13 05:36:02 PDT
Created attachment 462312 [details]
High CPU usage

Hi,

I am not sure if this is a regression of Safari 16, but I have found that using the common trick to load a CSS asynchronously causes ton of reflow on Safari 16, which causes the CPU to skyrocket. You can reproduce that here: https://codepen.io/bakura10/pen/bGMwxKB

Apparently, the load event is called over and over, which seems to cause constant reflow.

If we load the CSS without that, the CPU consumption goes back to normal.
Comment 1 mic.gallego 2022-09-13 05:36:20 PDT
Created attachment 462313 [details]
Without asynchronous loading trick
Comment 2 Ahmad Saleem 2022-09-13 07:19:36 PDT
rniwa@wekit.org - this is again same story:

...media="print" onload="this.media='all'">

I think it is already fixed in ToT via bug 232309.

Is this shipped in Safari 16?
Comment 3 Sam Sneddon [:gsnedders] 2022-09-13 16:57:46 PDT
This was fixed in the re-landing of bug 232309.

*** This bug has been marked as a duplicate of bug 232309 ***
Comment 4 Alexey Proskuryakov 2022-09-14 08:57:16 PDT
Was this also fixed by reverting older versions of that change?
Comment 5 Alexey Proskuryakov 2022-09-14 17:56:43 PDT
Actually, this couldn't be caused by an older version of that fix, as it never shipped.
Comment 6 Ryosuke Niwa 2022-09-14 21:41:54 PDT

*** This bug has been marked as a duplicate of bug 244879 ***
Comment 7 Alexey Proskuryakov 2022-09-14 22:21:58 PDT
So, this cannot possibly be a dupe of bug 244879...
Comment 8 Alexey Proskuryakov 2022-09-14 22:23:20 PDT
Unless the history of merges that I'm looking at is somehow all wrong...
Comment 9 Alexey Proskuryakov 2022-09-15 09:35:04 PDT
If you observed this issue with Safari Technology Preview, then it is indeed fixed by bug 244879.

However, please let us know if you saw (and continue to see) it with an actual Safari 16 beta or release.