Bug 230751
| Summary: | REGRESSION (Safari 15): Protomaps is very slow/hangy in Safari (large paths?) | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> |
| Component: | Canvas | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | bdon, dino, heycam, simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Simon Fraser (smfr)
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/83497019>
Brandon Liu
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
Simon Fraser (smfr)
Thanks for the update, we're tracking this regression.
Brandon Liu
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.
Cameron McCormack (:heycam)
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.
Brandon Liu
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
Cameron McCormack (:heycam)
Thanks for confirming.
*** This bug has been marked as a duplicate of bug 231157 ***