SuccessChanges

Summary

  1. Optimize DataWatcher (commit: 05d074d) (details)
Commit 05d074d5571bdf39bb4264c7f26b9cec417acf42 by Spottedleaf
Optimize DataWatcher
The lock in DataWatcher is used to prevent concurrent modifications to
the 'd' field (entries in MCP). However any modifications to this map
only occur on initialization of an Entity in its constructor. This
modification is write-locked.
Every other access is through a readlock, which allows the threads to
pass if there is no thread holding the writelock.
Since the writelock is only obtained in the constructor of the Entity,
the further readlocks are actually useless (which get obtained on set,
get, etc calls).
The entries field ('d' currently) has also been declared as
Int2ObjectOpenHashMap to avoid autoboxing on put(), get(), etc calls.
(commit: 05d074d)
The file was addedSpigot-Server-Patches/0393-Elide-lock-in-DataWatcher.patch
The file was modifiedSpigot-Server-Patches/0079-Use-Optimized-Collections.patch (diff)