-
Notifications
You must be signed in to change notification settings - Fork 311
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
Starting the game server takes too long #10
Comments
I have another idea as well: |
…graph as json by using postgres json functions. Part of a proof-of-concept for #10 - not complete or polished yet. The usage of the query and parsing of the json result is not implemented yet. Also many-to-many relationships are not considered yet.
I added a query builder yesterday. Today, I refined it a bit and it seems to be a bit tougher task to deserialize it to an object - my brain is actually hurting a bit ;-) Just a small list of problems I need to solve next:
The good news is, it actually seems to work. In my first tests the loading time went down to 10 seconds, with much room for improvement :) |
…urn them as json for better performance See also #10. Also prepared to use it for accounts - we still have some minor issues there. For example an ItemStorage loads it's items, and items load the item storage which tries to load it's items again... and so on. So the JsonObjectLoader needs some adjustments to handle such cases. Another limitation of the new approach for the GameConfiguration is, that the DbContext can't track the changes anymore. It contains circular references, so we load this json twice, whereas the first run is just there to fill the cache of the IdReferenceResolver - leading to different (but same) instances with the same Id - the change tracker is not afraid about that ;)
I got it now working completely (as far as I can see...). The server is now using json queries to retrieve the GameConfiguration. It takes now ~5 seconds to load it - not so bad :) |
Created issue #11 for the account loading. As this issue is resolved for now, I'm closing it. |
After extending some game map initialization data where I added NPCs and Monsters and their spawn points with 792148e, the startup time has gone up from around 15 seconds to over a minute. This is caused by loading the GameConfiguration which includes all this data.
I think when adding the rest of the data to the configuration it could take several minutes to load the GameConfiguration - not acceptable.
Maybe it's time to investigate how to integrate a document database (or a similar approach), where we have the GameConfiguration in just one document.
The text was updated successfully, but these errors were encountered: