Commit Graph

1 Commits

Author SHA1 Message Date
PaulBGD
06d82e0d6d
Cache palette array (#6767)
Instead of allocating the 4KB for every chunk section, cache it locally and
reuse it for other chunk sections to save on allocations. These allocations add
up very quickly when saving chunks frequently.

For example, with 30,000 chunks and 16 chunk sections per chunk (which will
actually get larger in 1.18) it allocates nearly 2GB, which this patch
eliminates entirely.
2021-11-05 15:52:32 +01:00