Chromium 77 changes to getCanvasData breaks selection performance.
See original GitHub issueDescribe the bug
Chromium changes to getCanvasData (which drives forEachFeatureAtPixel
) has reduced performance of OpenLayers selection by 50-100x
To Reproduce Steps to reproduce the behavior:
- Open Chrome 77
- Play with the Select Features example and monitor performance (https://openlayers.org/en/latest/examples/select-features.html)
Expected behavior 50-100x faster performance in my experience. My personal app now takes 800ms to select a feature.
Discussion https://bugs.chromium.org/p/chromium/issues/detail?id=1001845
It looks like the Chromium team might try to mitigate this, but they have also indicated it was known and intentional. It’s possible we need to re-work how OpenLayers does selection. Is there a way to limit how many calls to getCanvasData
it has to make? I see it making dozens for a single selection. I imagine this is related to testing against many candidate features in the r-tree?
Workarounds
You can disable 2D Canvas Acceleration in Chrome via chrome://flags
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
Looks like they’re pretty committed to fixing this and next release sounds probable: https://bugs.chromium.org/p/chromium/issues/detail?id=1001845#c14
@nikess Should be done in a week or so.