Bug 241458 - REGRESSION (iOS 15.5): Angular Materials style triggers poor performance on a long scrolling page
Summary: REGRESSION (iOS 15.5): Angular Materials style triggers poor performance on a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Critical
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-06-09 04:48 PDT by Jesper Bendtsen
Modified: 2022-08-01 15:38 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Bendtsen 2022-06-09 04:48:44 PDT
Scrolling and showing content was running smooth with this css on parent div before iOS 15.5:

-webkit-backface-visibility: hidden !important;
-webkit-transform: translate3d(0, 0, 0) !important;

But now it flickers a lot, when the page gets big.

Images are object URLs created with createObjectURL

See this video, about 60 images on the page (Was no problem before)

https://vimeo.com/718669517/ea2c09b281

please help my users complain?
Comment 1 Jesper Bendtsen 2022-06-10 22:36:12 PDT
If I remove all Angular Material inputs on the page that use CSS animation, transition and transform it runs smooth again!
Comment 2 Alexey Proskuryakov 2022-06-12 21:55:28 PDT
Would it be possible to provide a reproducible test case? Seems unlikely that this can be investigated based on a video alone.
Comment 3 Jesper Bendtsen 2022-06-13 00:12:25 PDT
Fair enough I will create a demo page, I will return with url
Comment 4 Jesper Bendtsen 2022-06-15 13:44:15 PDT
Im trying to create an demo to show the problem with same css style applied etc., but is not easy, because the system where the problem occurs is complex...

Demo app:
https://mango-tree-0ed834c03.1.azurestaticapps.net/

The problem do not occur in the demo, super weird... But again is not 100% the same as the system... Is it possible that I can give you access to the test system? I need to create you as user (requires an email address)
Comment 5 Jesper Bendtsen 2022-06-16 00:46:41 PDT
Changed all components to "changeDetection: ChangeDetectionStrategy.OnPush" in the Angular project for using less CPU power.

I'm confused, do not understand what's going on, se this two videos, is exactly the same page.

Chrome on Windows 10
https://vimeo.com/720963827/df4a1e5477

Safari iOS 15.5 (iPad pro 2020)
https://vimeo.com/720965154/b2ba11d77d
Comment 6 Radar WebKit Bug Importer 2022-06-16 04:49:12 PDT
<rdar://problem/95287714>
Comment 7 Simon Fraser (smfr) 2022-06-16 12:13:05 PDT
Can you use Web Inspector timelines to see what is slow? Are you just running lots of script, or is layout or composite slow?
Comment 8 Simon Fraser (smfr) 2022-06-21 21:17:03 PDT
I was able to log in and do some debugging. As you noted, the Angular Materials style is triggering some poorly performing content, causing excessive work on every scroll. For some reason that I don't yet understand, this is much worse on iOS than macOS.

For now I'd advise not using the Angular Materials for buttons etc; choose an alternate style if you can.
Comment 9 Simon Fraser (smfr) 2022-07-18 21:47:40 PDT
This is much worse on iOS because we get a flood of "didScroll" messages to the web process, so update composting layers for lots of small scroll increments.

On macOS, where scrolling and compositing updates happen in the same process, we coalesce via ScrollingTree::m_pendingScrollUpdates.
Comment 10 Simon Fraser (smfr) 2022-07-27 14:29:42 PDT
Pull request: https://github.com/WebKit/WebKit/pull/2790
Comment 11 EWS 2022-08-01 15:38:34 PDT
Committed 253015@main (e7b60434701b): <https://commits.webkit.org/253015@main>

Reviewed commits have been landed. Closing PR #2790 and removing active labels.