OpenGeoscience / geojs

High-performance visualization and interactive data exploration of scientific and geospatial location aware datasets
https://opengeoscience.github.io/geojs
Apache License 2.0
441 stars 75 forks source link

getError performance issue #1174

Closed jeffbaumes closed 2 years ago

jeffbaumes commented 2 years ago

When looking into possible performance issues while panning and zooming, I came across this:

image

It seems getError from _renderImageQuads, which apparently is checking for out of memory errors, is taking up about 60% of the time. In some longer frames it takes up even more (here 95%):

image

I found this documentation stating why it's so slow.

https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#avoid_blocking_api_calls_in_production

Should this check be removed?

Note this is from looking at this example:

https://demo.kitware.com/histomicstk/#item/61fc3f6c3ac19d243a3f32e9

manthey commented 2 years ago

The check was added because a user had a memory issue that was not at all apparent -- just losing the context. Probably it could be changed to only check after we try to load a texture that is larger in pixels than any texture we've loaded before which should balance the desire for checking with performance.

jeffbaumes commented 2 years ago

That could work. It seems in the example I was trying, it was hitting that check all the time. I notice for example here it does not seem to hit that check at all, must be the tile size in the histomics example is larger.

manthey commented 2 years ago

The version of geojs on demo.kitware.com is probably older AND therefore hitting the check all the time rather than only for large textures, whereas the version deployed from github is current master and therefore only checks if the texture is over 4k^2.

jeffbaumes commented 2 years ago

Ah ok, so basically it's a solved issue, thanks. Sorry for the noise!

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.7.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: