Closed R-T-B closed 2 years ago
0.9.2 improves this a lot, but it still needs work over time so leaving this open. Info on the timings doc.
It seems we could optimize by using native types instead of so many dictionaries for JSON. We should investigate this when possible.
Also, loop combining.
Hello! I found out that a major timesink is string handling in MapFileTools.GenerateArrayStrings(). I made some changes and created a Pull Request #6 that would improve performance significantly
Merged. Thank you very much! I will leave this open until I evaluate the dictionary situation, but this has massively helped things.
I'm not even sure I need to leave this open, lol, the new benches are in and that one change led to up to 677% improvements on 384x384 on modern hardware. We're talking 384x384 in under 1 minute for most modern PCs!
I'm still going to look at dictionary optimizations but holy crap...
https://github.com/R-T-B/TimberbornTerrainGenerator/blob/main/timings.md
Closing. It has been proven that the majority of the mod is now load times rather than the mod itself, thus work (and further benches) are now unneccesary).
Map generation as of release 0.9.0 is both infinitely more flexible, and infinitely slower. C# is not a slower language than Python, it's much faster, and even though we are doing much more, we should try to optimize where we can.
This documents that effort. Starting metrics as of 0.9.0 can be found here:
https://github.com/R-T-B/TimberbornTerrainGenerator/blob/main/timings.md