Commit Graph

5 Commits

Author SHA1 Message Date
Aikar
38f0f0b71a
Disable use of Locks on main thread for DataPaletteBlock
This should greatly improve performance by using a No Op lock
while on the main thread.

Vanilla always had a write lock on write operations, but we added
a Read Lock during Async Chunks to make concurrent writes non fatal
for Async Chunks.

This means we added on a bunch of over head to all chunk read operations.

This corrects that, as well as disabling the write lock while on main thread.

It is a general rule that you do not touch a chunk async once it is loaded
into the world, as we never had locks on the chunk before 1.13 even.

So once we are on main, we don't expect concurrent access to begin with,
so we don't need the write locks either.
2018-10-02 22:29:31 -04:00
Aikar
920bf4680b
[Auto] Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
68588dac SPIGOT-4405: Chunk generation problem
2018-10-02 09:06:52 -04:00
Aikar
6371b4581d
Fix Async Chunk Load Callback if chunk was already loaded
Fixes ACL API mainly, but might fix other smaller things too

Also improved the high priority check if the chunk was already marked done
2018-10-01 01:00:09 -04:00
Aikar
48b1b0aac5
Optimize Spare Chunk loads to be removed faster
this has technically been a longer standing problem, but if an async
chunk loads after a chunk has been removed from the chunk map, it would
be treated as any other spare chunk and kept loaded until Chunk GC kicks in.

This fixes that, but also obsoletes ChunkGC in that anytime we load a spare
chunk (a chunk outside of any players view distance), we will immediately
mark it for unload.

This should reduce the amount of spare chunks loaded on a server.
2018-09-30 20:34:05 -04:00
Aikar
08bb5b49d2
Fix Sending Chunks to Client - Fixes #1504
Vanilla has some screwy logic that doesn't send a chunk until
it has been post processed. This is an issue as post processing
doesn't occur until all neighbor chunks have been loaded.

This can reduce view distance while generating terrain, but also
cause bugs where chunks are never sent to the client.

This fix always sends chunks to the client, and simply updates
the client anytime post processing is triggered with the new chunk data.
2018-09-29 01:22:21 -04:00