mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-26 02:19:19 +00:00
[ci skip] benchmark numbers part. 1
This commit is contained in:
@@ -3,6 +3,9 @@ From: Taiyou06 <kaandindar21@gmail.com>
|
||||
Date: Thu, 20 Feb 2025 15:37:39 +0100
|
||||
Subject: [PATCH] Improve sorting in SortedArraySet
|
||||
|
||||
Changes between 5% to 10% depending on the size of the array
|
||||
For size 16: ~5% improvement (735.589 ns vs 697.095 ns)
|
||||
For size 4096: ~10% improvement (1563.115 ns vs 1396.803 ns)
|
||||
|
||||
diff --git a/net/minecraft/util/SortedArraySet.java b/net/minecraft/util/SortedArraySet.java
|
||||
index 339b19e88567be382e550ed54477fabd58d51faa..3de282a68bd125ad17fee47bebef3835a860c170 100644
|
||||
|
||||
@@ -3,6 +3,8 @@ From: Taiyou06 <kaandindar21@gmail.com>
|
||||
Date: Fri, 21 Feb 2025 18:05:09 +0100
|
||||
Subject: [PATCH] Optimize LinearPalette
|
||||
|
||||
getSerializedSize is 76% faster: 70.3ns → 17.2ns
|
||||
getSerializedSize.write is 13-21% faster: 659.5ns → 523.1ns
|
||||
|
||||
diff --git a/net/minecraft/world/level/chunk/LinearPalette.java b/net/minecraft/world/level/chunk/LinearPalette.java
|
||||
index 2073f6ff41aa570102621d183ee890b076267d54..2595ab14e2edd9c0f113f8997b0d3290a2c2fcad 100644
|
||||
|
||||
@@ -6,6 +6,8 @@ Subject: [PATCH] Slightly optimized VarInt#write
|
||||
Use switch case instead of if-else for branches. It makes it able to use
|
||||
tableswitch instruction for better efficiency.
|
||||
|
||||
Improves it around 1% to 5%
|
||||
|
||||
diff --git a/net/minecraft/network/VarInt.java b/net/minecraft/network/VarInt.java
|
||||
index 6f8dd31582f0e1d3a71acc7a142c1f4ec0539d9e..4c9095995e8515c61d54f1c056be35a12a138ef3 100644
|
||||
--- a/net/minecraft/network/VarInt.java
|
||||
|
||||
Reference in New Issue
Block a user