Schedule the "main thread" part of tile loading more intentionally #507
Labels
performance
Improvements to performance, including reductions in memory usage
research
Explore an idea or prototype a concept and share the results
Currently, the process of loading a tile is split into two parts:
Future-based load pipeline
This happens almost entirely in a worker thread, and consists of:
At the end of this process, the Tile is in the
ContentLoaded
state.Main thread update
This happens during tile selection in the main thread. Whenever we visit a tile in the
ContentLoaded
state, we do some additional processing and immediately (synchronously) move it to theDone
state. The work done here consists of:#473 suggests separating step 1 from the rest, so that we can, say, have 20 network requests in flight at once but use a smaller number of threads for the CPU work in steps 2-6.
But this issue is about step 8. cesium-native basically assumes that
ContentLoaded
andDone
are equivalent for selection purposes, because aContentLoaded
tile can and will be synchronously moved toDone
. We should allow more flexibility in when this happens. We don't need to do it for every tile we visit; only tiles that we're actually going to render. And conversely, too many tiles sometimes hit theContentLoaded
state all at once, causing noticeable rendering pauses as we create renderer resources (including uploading data to the GPU) all at once.With more flexibility, we can avoid eagerly creating GPU resources for tiles we're unlikely to need. And we can also throttle and prioritize resource creation to avoid major frame rate drops.
The text was updated successfully, but these errors were encountered: