Ask questionsWebGLPointsLayer Performance Issues

Initial Report

I've got 4 WebGLPointsLayers rendering about 15 000 points total using 1 spritesheet of 1024x512 resolution. My GTX 1050 runs it fine, but I recently discovered that it eats about 3GB of VRAM to do this. I also found that the GPU while in high performance mode idles at about 4% but any panning or zooming and it shoots up to about 80%.

  • Is this surprising or unexpected?

  • If it is surprising, what can I gather in terms of context/dumps/logs to support understanding the problem? (I suspect trying it in other browsers and on other machines might help)

  • Are there any performance best practices for WebGLPointsLayer?

  • Is it useful to be discussing this kind of thing, or are we still in very early stages of "experimental" and major performance issues are unsurprising and not all that useful at the moment?

I appreciate that this is an experimental feature. I'm not sure where else to open discussions on what I discover, but I hope that they are useful in some manner.

Edit: Attempted with AMD GPU

I tried the same application on my other PC running an AMD RX580 and get the same behaviour. Panning takes 80% GPU until I stop, and about 700MB of VRAM per WebGLPointsLayer instance.

Next steps

Unless someone jumps in and explains it and that more work is a waste of time, I'm going to assemble a minimum build with one of the layers and keep incrementing it towards my application's setup until I better understand what inputs cause such huge resource costs.


Answer questions ablakey

Thanks, I'll work on an example at work today.

To confirm, if I update just one feature's geometry, that causes a full rebuild of the layer that the feature is found in?

Will mutations and redraws of other canvas layers cause any impact on the WebGL programs (ie. GPU usage)?

My understanding is that every layer is built and managed uniquely and merged together as rasters with transparency at the end of the render pipeline. This means that highly mutative layers shouldn't affect the mostly static layers?

To give a little context why I ask, I've got about 16 layers, only 4 of which are WebGL:

  • 10 000 navigable robot poses
  • 10 000 reference points related to those poses
  • charging docks
  • queues
  • polygons describing rules/behaviour
  • annotations and measurements
  • real-time robot position data, sensor data, path planning, goals.
  • extra label layers for most of these (given the WebGL layers cannot have labels in WebGL as far as I can tell)

So it's an interesting mix of layers that rarely change (once a week for the WebGL layers) and layers that change many times a second (robot positions via canvas Vector Icons)


Related questions

Memory leak in Openlayers 6 beta hot 1
Click event on specific layer issue in OpenLayers 5 hot 1
Ol3 with mbtiles hot 1
Canvas elements not garbage collected on iOS 12 hot 1
Github User Rank List