Paper/paper-server/patches/sources/net/minecraft
Techcable 85be8cc620 Improve BlockPosition inlining
Normally the JVM can inline virtual getters by having two sets of code, one is the 'optimized' code and the other is the 'deoptimized' code.
If a single type is used 99% of the time, then its worth it to inline, and to revert to 'deoptimized' the 1% of the time we encounter other types.
But if two types are encountered commonly, then the JVM can't inline them both, and the call overhead remains.

This scenario also occurs with BlockPos and MutableBlockPos.
The variables in BlockPos are final, so MutableBlockPos can't modify them.
MutableBlockPos fixes this by adding custom mutable variables, and overriding the getters to access them.

This approach with utility methods that operate on MutableBlockPos and BlockPos.
Specific examples are BlockPosition.up(), and World.isValidLocation().
It makes these simple methods much slower than they need to be.

This should result in an across the board speedup in anything that accesses blocks or does logic with positions.

This is based upon conclusions drawn from inspecting the assenmbly generated bythe JIT compiler on my microbenchmarks.
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
2016-11-30 20:56:58 -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 InventoryCloseEvent Reason API 2018-07-03 21:56:23 -04: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 PlayerLaunchProjectileEvent 2018-07-21 03:11:03 -05: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