ProtocolLib

3M Downloads

1.20.6 PacketFilterManager.createPacket Performance

Dinos3396 opened this issue ยท 1 comments

commented

The performance for creating a new packet on 1.20.6 is terrible, on 1.20.4 it was so much better.

https://spark.lucko.me/wrwZuZrCCM
https://mclo.gs/jZ9e6QF

Just to confirm, on 1.20.4 the performance is perfect. I dont understand why the performance is so bad on 1.20.6, the plugin that spikes at 80% was never above 1% back on 1.20.4 and nothing else changed, basically almost all plugins that were using protocolib that had excellent performance, now its terrible.

commented

The issue is likely that we don't store a non-null value in the FAST_MAP_CONSTRUCTORS cache, causing it to be continuously looked up because null doesn't count as a "valid" value for computeIfAbsent.

https://github.com/dmulloy2/ProtocolLib/blob/47bcd53fd02041b77800910bcabd4382075bed06/src/main/java/com/comphenix/protocol/reflect/instances/MinecraftGenerator.java#L57C66-L57C81