Skip to content

ChunkSending

BonsUnleashed edited this page Oct 7, 2026 · 3 revisions

ChunkSending

Minecraft 1.20.1 / Forge: this page documents that build and its measurements. For the separate 170-control Minecraft 1.21.1 port, see Minecraft 1.21.1 NeoForge.

One control for ChunkSending 3.7 (mod id chunksending): cached chunk packets expire from a queue instead of a pass over every entry each tick. ChunkSending is All Rights Reserved, so the mixin holds only two injectors that call our own helper; ChunkSending's code stays in its jar. The switch checks the code it would change against the tested build; another build is left untouched with one WARN line (see How the patches are applied).

Key Target Side Since Kind Result
chunksending_expiry_queue ChunkSending 3.7 BOTH 1.0.23 opt a queue instead of a walk over every cached packet per tick

chunksending_expiry_queue

Since: 1.0.23 · Side: BOTH · Mixin: ExpiryQueueMixin · Helper: bons.furious.patch.chunksending.ChunkSendingExpiry Patched: ChunkSending's EventHandler.addToClear and clearExpiredPacketCaches (two injectors; the original code stays)

What upstream did. Every cached chunk packet is registered with a five-minute deadline, and at the start of every server tick ChunkSending walked all registered packets to drop the few that had expired, so the walk grew with the number of cached chunks.

What the patch does. Deadlines are also kept in arrival order, which is deadline order, and each tick only takes the expired ones from the front; a packet registered again keeps its newer deadline. The same packets are dropped in the same tick as before.

What stays the same. Which caches are cleared when: offline 30,000 ticks cleared exactly the caches of the original walk; in game every cached chunk packet waiting for expiry (453) had its queue record.

Measured. The sweep was 2.0-2.5 % of the server thread in review 8.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally