Commit Graph

3 Commits

Author SHA1 Message Date
Aikar
230b8d4258
Merge pull request #1256
bfbd24c5 Fix decompile error (Hugo Manrique)
1f5d23d9 Re-add Vanished players don't have rights patch (Hugo Manrique)

* pull/1256/head:
  Fix decompile error
  Re-add Vanished players don't have rights patch
2018-07-25 19:41:35 -04:00
Aikar
c280d84172
Update upstream and remove hopper patch for #1270 2018-07-25 01:11:08 -04:00
Aikar
84d229cd29
Optimize Region File Cache
CraftBukkit added synchronization to read and write methods. This adds
much more contention on this object for accessing region files, as
the entire read and write of NBT data is now a blocking operation.

This causes issues when something then simply needs to check if a chunk exists
on the main thread, causing a block...

However, this synchronization was unnecessary, because there is already
enough synchronization done to keep things safe

1) Obtaining a Region File: Those methods are still static synchronized.
   Meaning we can safely obtain a Region File concurrently.

2) RegionFile data access: Methods reading and manipulating data from
   a region file are also marked synchronized, ensuring that no 2 processes
   are reading or writing data at the same time.

3) Checking a region file for chunkExists: getOffset is also synchronized
   ensuring that even if a chunk is currently being written, it will be safe.

By removing these synchronizations, we reduce the locking to only
when data is being write or read.

GZIP compression and NBT Buffer creation will no longer be part of the
synchronized context, reducing lock times.

Ultimately: This brings us back to Vanilla, which has had no indication of region file loss.

Closes #1260
2018-07-23 23:50:09 -04:00