branchrust_reboot/main/optimize_spawn_distributioncancel
57 Minutes Ago
Reduce memory usage of the server's SpawnDistributions by 750MB (780MB -> 40MB) and make it 3x faster to sample (2.1 us -> 0.7 us) - store in tiles of 16x16 values - 85% of the tiles are all zeros (fun fact) - tiles that are all the same value store as negative tile index so it can avoid looking up the tile (mainly all zeros) - deduplicate the remaining tiles (saves a little more) - palette packing on top for tiles that have mixed values (2 - 4 bits / value) - reduces server startup time from 4s -> 2.5s