Bug 230751 - REGRESSION (Safari 15): Protomaps is very slow/hangy in Safari (large paths?)
Summary: REGRESSION (Safari 15): Protomaps is very slow/hangy in Safari (large paths?)
Status: RESOLVED DUPLICATE of bug 231157
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-24 08:19 PDT by Simon Fraser (smfr)
Modified: 2021-10-28 21:22 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2021-09-24 08:19:43 PDT
https://protomaps.github.io/protomaps.js/examples/leaflet.html#11/35.6079/139.7458 is very slow, to the point of hanging.

Seems like a canvas/GPU process thing.
Comment 1 Radar WebKit Bug Importer 2021-09-24 08:20:28 PDT
<rdar://problem/83497019>
Comment 2 Brandon Liu 2021-09-27 18:46:31 PDT
Hi, library author here. To describe what I'm seeing: On Safari 15 on macOS Big Sur, Technology Preview, and iOS 15 Safari, the tab will either crash or the UI thread will hang randomly after panning/zooming for a while, sometimes immediately on page load.

I can confirm that turning off “GPU Process: Canvas Rendering” fixes the problem, but that isn't a viable workaround for users.

From experimenting with the Canvas calls in the library it seems to be related to rasterizing a path (context.fill(), context.stroke()) with hundreds to thousands of vertices.

Similar bug reports:

1. https://developer.apple.com/forums/thread/685866
2. https://github.com/ant-design/ant-design-charts/issues/855
3. https://github.com/flutter/flutter/issues/89655
Comment 3 Simon Fraser (smfr) 2021-09-27 19:01:20 PDT
Thanks for the update, we're tracking this regression.
Comment 4 Brandon Liu 2021-10-13 01:01:24 PDT
As an update, I'm pretty sure the root cause here is the same at https://bugs.webkit.org/show_bug.cgi?id=231157 .

I've implemented a workaround for the library to limit the # of vertices in a single call to stroke() or fill(). It's been successful so far on the devices I've tested, will report back after more testing.
Comment 5 Cameron McCormack (:heycam) 2021-10-28 17:33:52 PDT
Brandon, is the workaround already present in the URL Simon linked in comment 0?  Testing with that URL I couldn't reproduce the hanging.

If so, then we should probably just dupe this bug to the long path issue in bug 231157.
Comment 6 Brandon Liu 2021-10-28 18:58:46 PDT
Cameron,

There is a partial workaround implemented on that page which makes it more difficult to reproduce, but the crash/hang is still present; I do believe the root cause is the same, so you can mark this as a dupe.

Brandon
Comment 7 Cameron McCormack (:heycam) 2021-10-28 21:22:08 PDT
Thanks for confirming.

*** This bug has been marked as a duplicate of bug 231157 ***