mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 23:43:57 +01:00
5b9950b5f7
When a chunk is loaded the server tries to ensure it has its initial light calculations done before sending it to the player. When ticking entities the server tries to ensure the entity does not walk into an unloaded chunk. To accomplish these the server checks a one chunk radius around the chunk to be lit or a two chunk radius around the chunk the entity is in. These lookups happen every tick even though their result is unlikely to change that often. To reduce the cost of these checks we replace them with a system to keep track of what neighbor chunks a chunk has loaded and update it when chunks load or unload which is a much less frequent action. On a server with ten players this change removes about 100,000 calls a tick to LongObjectHashMap's containsKey method. |
||
---|---|---|
.. | ||
java | ||
resources |