You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a large dataset determineFrustumSet is taking 1.03ms out of 1.35ms time for update. LRUCache.markUsed seems to take a large chunk of that time, too. Removing the indexOf, splice, and push array operations seems to improve things quite a bit.
Solution
We should remove the splicing and updating of the itemList array in markUsed and instead sort the array into the appropriate order only when we need to in unloadUnusedContent. We should always sort and only use unloadPriorityCallback when it's available. If it's not available we should sort by "last used time" such that the most recently used items (but currently unused) are first in the array after the currently used items. The last used time can be bookkept in a usedMap (which can replace usedSet). This should keep the behavior the same but defer the array update until necessary and the sort itself should be faster than array splicing.
Note
DetermineFrustumSet is still the dominating function in update. The rest can probably be attributed to the frustum and error calculations. There may be ways to improve those functions, as well.
The determineFrustumSet function seems to dominate time in terms of
update
function time. See if we can improve performance.The text was updated successfully, but these errors were encountered: