Commit graph

2 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 0c9bb9b7ae
Don't recheck type after setting a block
The server does a "Did my update succeed" check after setting
a blocks data to a chunk.

However, writes can not fail outside of a hard error or a
a race condition from multiple threads writing, which is
not something that should ever occur on the server.

So this check is pointless, as if it did occur, the server would
be having data corruption issues anyways.

This provides a small boost to all setType calls.
2018-09-28 22:40:04 -04:00