13
0
geforkt von Mirrors/Paper
Paper/paper-server/patches/sources/net/minecraft
egg82 f6519a79fe Use ConcurrentHashMap in JsonList
This is specifically aimed at fixing #471

Using a ConcurrentHashMap because thread safety
The performance benefit of Map over ConcurrentMap is negligabe at best in this scenaio, as most operations will be get and not add or remove
Even without considering the use-case the benefits are still negligable

Original ideas for the system included an expiration policy and/or handler
The simpler solution was to use a computeIfPresent in the get method
This will simultaneously have an O(1) lookup time and automatically expire any values
Since the get method (nor other similar methods) don't seem to have a critical need to flush the map to disk at any of these points further processing is simply wasteful
Meaning the original function expired values unrelated to the current value without actually having any explicit need to

The h method was heavily modified to be much more efficient in its processing
Also instead of being called on every get, it's now called just before a save
This will eliminate stale values being flushed to disk

Modified isEmpty to use the isEmpty() method instead of the slightly confusing size() < 1
The point of this is readability, but does have a side-benefit of a small microptimization
2018-08-07 01:24:23 -06:00
..
advancements Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
commands Add UnknownCommandEvent 2017-06-17 18:48:21 -04:00
core Improve BlockPosition inlining 2016-11-30 20:56:58 -06:00
nbt MC Dev fixes 2016-03-30 19:36:20 -04:00
network Disable Explicit Network Manager Flushing 2018-03-11 14:13:33 -04:00
resources MC Dev fixes 2016-03-30 19:36:20 -04:00
server Use ConcurrentHashMap in JsonList 2018-08-07 01:24:23 -06:00
stats Allow statistics to be disabled/forced 2014-01-07 15:56:26 +00:00
util PreCreatureSpawnEvent 2018-01-14 17:01:31 -05:00
world Add Debug Entities option to debug dupe uuid issues 2018-07-21 08:25:40 -04:00
ChatFormatting.java.patch Adventure 2021-01-29 17:54:03 +01:00
CrashReport.java.patch Deobfuscate stacktraces in log messages, crash reports, and etc. 2021-06-20 18:19:09 -07:00
CrashReportCategory.java.patch Deobfuscate stacktraces in log messages, crash reports, and etc. 2021-06-20 18:19:09 -07:00
Util.java.patch Do not submit profile lookups to worldgen threads 2021-08-08 16:26:46 -07:00