PaperMC/paper-server/patches/sources/net/minecraft/world/level
stonar96 71ac6d7e6a Optimize HashMapPalette
HashMapPalette uses an instance of CrudeIncrementalIntIdentityHashBiMap
internally. A Palette has a preset maximum size = 1 << bits.
CrudeIncrementalIntIdentityHashBiMap has an initial size but is
automatically resized. The CrudeIncrementalIntIdentityHashBiMap is created
with the maximum size in the constructor of HashMapPalette, with the aim
that it doesn't need to be resized anymore. However, there are two things
that I think Mojang hasn't considered here:
1) The CrudeIncrementalIntIdentityHashBiMap is resized, when its initial
size is reached and not the next time, when a further object is added.
2) HashMapPalette adds objects (unnecessarily) before checking if the
initial size of CrudeIncrementalIntIdentityHashBiMap is reached.
This means to actually avoid resize operations in
CrudeIncrementalIntIdentityHashBiMap, one has to add 2 to the initial size
or add 1 and check the size before adding objects. This commit implements
the second approach. Note that this isn't only an optimization but also
makes async reads of Palettes fail-safe. An async read while the
CrudeIncrementalIntIdentityHashBiMap is resized is fatal and can even lead
to corrupted data. This is also something that Anti-Xray is currently
relying on.
2021-01-17 01:11:36 +01:00
..
biome Optimize Biome Mob Lookups for Mob Spawning 2018-09-12 21:47:01 -04:00
block Fix Spigot growth modifiers 2021-12-03 17:09:24 -08:00
border Add worldborder events 2021-01-04 22:40:34 -08:00
chunk Optimize HashMapPalette 2021-01-17 01:11:36 +01:00
dimension/end Prevent softlocked end exit portal generation 2021-08-30 15:22:18 +02:00
entity Improve and expand AsyncCatcher 2021-08-25 20:17:12 -07:00
gameevent Use getChunkIfLoadedImmediately in places 2019-07-08 00:13:36 -07:00
levelgen Fix CocaoDecorator causing a crash when trying to generate without logs 2021-09-07 21:29:38 +01:00
material Add BlockBreakBlockEvent 2021-01-03 17:58:11 -08:00
pathfinder Mob Pathfinding API 2018-09-09 13:30:00 -04:00
portal Add configurable portal search radius 2016-03-03 02:46:17 -06:00
redstone Prevent NoClassDefError crash and notify on crash 2014-04-21 12:43:08 +01:00
saveddata/maps Limit item frame cursors on maps 2021-05-26 15:09:33 -07:00
storage Preserve overstacked loot 2021-06-21 23:21:58 -04:00
BaseCommandBlock.java.patch Add permission for command blocks 2020-05-16 10:05:30 +02:00
BaseSpawner.java.patch Fix Entity Teleportation and cancel velocity if teleported 2020-08-25 20:45:36 -04:00
BlockGetter.java.patch Don't lookup fluid state when raytracing, skip air blocks 2020-08-28 12:33:47 -07:00
ChunkPos.java.patch MC Utils 2016-03-28 20:55:47 -04:00
ClipContext.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
EmptyBlockGetter.java.patch MC Utils 2016-03-28 20:55:47 -04:00
EntityGetter.java.patch SkeletonHorse Additions 2018-07-27 22:36:31 -05:00
GameRules.java.patch Add WorldGameRuleChangeEvent 2020-12-20 16:41:44 -08:00
Level.java.patch Make sure inlined getChunkAt has inlined logic for loaded chunks 2020-09-20 16:10:49 -07:00
LevelAccessor.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
LevelReader.java.patch MC Utils 2016-03-28 20:55:47 -04:00
LevelWriter.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
NaturalSpawner.java.patch Add '/paper mobcaps' and '/paper playermobcaps' 2021-08-16 01:31:54 -05:00
PathNavigationRegion.java.patch MC Utils 2016-03-28 20:55:47 -04:00
ServerExplosion.java.patch Prevent headless pistons from being created 2020-08-14 14:44:14 -05:00
ServerLevelAccessor.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00