cheahjs / TerrariaAPI-Server

Fork is now over at https://github.com/NyxStudios/TerrariaAPI-Server
https://tshock.co
32 stars 24 forks source link

Significantly improved performance of world generation and all world tile operations #6

Closed stevenh closed 12 years ago

stevenh commented 12 years ago

While this does increase memory usage the trade off is well worth it given memory is cheep.

Tests on using a small map on a 2.4Ghz Core2 show:-

TileCollection stats can be enabled by the TILE_DEBUG #define

It may be interesting to note that this should also work without the removal of the new Tile() assigns in the core code, in fact in theory it should make it even quicker as the conditional test on the array indexer would be in needed. This could make updates of future releases easier by reducing the changeset significantly.

Changed world file operations from copies to move's which eliminates unnecessary disk thrashing for world save and backups