Perform Temporary Caching #176
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #117
Re-do of #174
Includes #175
This pull request is a redo of the improving world load time enhancement, which had a very high memory usage. This version is able to get to <15 seconds from world startup to the player loading like the last pull request, but results in the world loading in at <160 MBs instead of ~280 MBs. This is done by briefly caching tables for a couple of seconds when read so that a sudden amount of reads doesn't constantly re-read the database while also not causing the memory hit of keeping all the tables in memory as structs.
Last time, it was found that using caching for some components would result in load times in the minutes. However, I found that there is an inefficiency with some of the table reads regarding
Lot.GetComponentId
. There were some cases that would call it in a Linq statement, like theDestroyableComponent
, which causes a database table read with each cycle instead of once before the Linq statement, like the new code. Table caching with the new method brought my Avant Gardens load time from >50 seconds to <30, and this change brought it from <30 to <15.