Related to #1407
Some tasks are time-sliced over multiple frames to split up the work and keep the frame rate up:
- PriorityQueue
- Tiling content downloading, parsing, preprocessing
- Image overlay processing
- QueryManager
- Time slice point settling per frame
- LRUCache
- Used for unloading TilesRendererBase tiles
- Used for unloading data in UnloadTilesPlugin
This work could be more quickly completed if we allow for it to run in an idle callback for a fixed amount of time. This would require adjusting PriorityQueue and LRUCache to be able to run for a fixed amount of time in addition to optionally iterating over a fixed amount of items (timing can possibly default to Infinity?) so we can take advantage of idle time. One caveat is that it's not supported in Safari:
requestIdleCallback( idle => {
// run for the provided idle time
const runTime = idle.timeRemaining();
queue.tryRunJobs( runTime );
// schedule idle callback again until work is complete?
} );
Perhaps a utility function can be written that can schedule frame work in addition to idle callback? This can't replace the rAF because we still need a guaranteed processing on the next frame.
Related to #1407
Some tasks are time-sliced over multiple frames to split up the work and keep the frame rate up:
This work could be more quickly completed if we allow for it to run in an idle callback for a fixed amount of time. This would require adjusting PriorityQueue and LRUCache to be able to run for a fixed amount of time in addition to optionally iterating over a fixed amount of items (timing can possibly default to Infinity?) so we can take advantage of idle time. One caveat is that it's not supported in Safari:
Perhaps a utility function can be written that can schedule frame work in addition to idle callback? This can't replace the rAF because we still need a guaranteed processing on the next frame.