PaperMC/paper-server/patches/sources/net/minecraft/server
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
..
bossevents Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
commands Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
dedicated Add Early Warning Feature to WatchDog 2018-08-08 15:30:52 -04:00
gui Use TerminalConsoleAppender for console improvements 2017-06-09 19:03:43 +02:00
level Add Debug Entities option to debug dupe uuid issues 2018-07-21 08:25:40 -04:00
network Break up and make tab spam limits configurable 2018-07-29 05:02:15 +01:00
packs Build system changes 2016-02-29 20:40:33 -06:00
players Use ConcurrentHashMap in JsonList 2018-08-07 01:24:23 -06:00
rcon Configurable RCON IP address 2016-04-16 00:39:33 -04:00
Bootstrap.java.patch Fix this stupid bullshit 2017-08-06 17:17:53 -05:00
Main.java.patch Basic PlayerProfile API 2018-01-15 22:11:48 -05:00
MinecraftServer.java.patch Add Early Warning Feature to WatchDog 2018-08-08 15:30:52 -04:00
PlayerAdvancements.java.patch Add PlayerAdvancementCriterionGrantEvent 2018-01-19 08:15:29 -06:00
ServerAdvancementManager.java.patch Configurable Advancement Disabling 2017-06-09 16:29:31 +10:00
ServerFunctionManager.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
ServerScoreboard.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
ServerTickRateManager.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
Services.java.patch Paper config files 2022-06-08 22:20:16 -07:00