| Summary: | REGRESSION (Safari 15)?: Appending img elements to the DOM is slow when 1Blocker is enabled | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | ben |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | bfulgham, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 17 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 17 | ||
| URL: | https://56f8f3.csb.app/ | ||
| Attachments: | |||
|
Description
ben
2023-11-05 18:09:16 PST
Had a few more people check this out and they didn't have the same issue. I figured out that this only happens when content blockers are enabled - I'm using 1Blocker for content blocking. I *also* have a similar level of content blocking enabled on Chrome, so I would still consider this a performance issue. Hi there, any update on this one? It's a pretty sizeable performance tax on anyone using content blockers. Would it be possible for you to collect some performance data using the `sample` command line tool, with and without 1Blocker enabled? Absolutely, I’ll do that soon. In the meantime, it seems likely that what’s happening is that the list of content blocking rules is being evaluated synchronously, on the main thread, when the element is inserted into the DOM, rather than checking during the download of the image which would presumably happen in a separate thread. An interesting side effect of this performance issue is that a page can pretty reliably detect when a user has content blockers enabled in Safari. Created attachment 471232 [details] Sample of loading https://56f8f3.csb.app with 1blocker enabled Created attachment 471233 [details] Sample of loading https://56f8f3.csb.app with content blockers disabled Sorry I was going to give more instructions once you said sampling was OK. WebKit uses a multi-process model so you need to find the appropriate web content process using Activity Monitor or `top` (quit Mail and close other Safari tabs to reduce the count). You can see which is the right process by looking to see which com.apple.WebKit.WebContent process uses CPU when interacting with the page. Then run `sample` with the PID of that webcontent process, while doing the image loaded. Created attachment 471282 [details] Sample of https://56f8f3.csb.app with 1Blocker enabled Created attachment 471283 [details] Sample of https://56f8f3.csb.app with content blockers disabled Let me know if there's any more I can do to help out with this. Were those traces helpful? This is still a pretty bad performance bug for users with content blockers enabled, and it may also enable fingerprinting and detection of content blockers. Is there anything else I can provide to help? |