Skip to content

Perform Temporary Caching #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 21, 2021
Merged

Perform Temporary Caching #176

merged 7 commits into from
Jan 21, 2021

Conversation

TheNexusAvenger
Copy link
Member

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 the DestroyableComponent, 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.

Copy link
Member

@MickVermeulen MickVermeulen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor style changes. Overall an amazing change that I've been looking forward to for a long time. Memory usage is completely within margin now too imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

World Loading is painfully slow
2 participants