perf: Cut encrypted outbound batch time by up to 73% - #473
Draft
kdcokenny wants to merge 10 commits into
Draft
Conversation
kdcokenny
marked this pull request as ready for review
August 24, 2026 18:36
Joniii11
suggested changes
Aug 24, 2026
|
This pull request has conflicts with the base branch "master". Please resolve those so we can test out your changes. |
|
Conflicts have been resolved! 🎉 |
kdcokenny
marked this pull request as draft
August 26, 2026 01:11
kdcokenny
marked this pull request as ready for review
August 26, 2026 17:52
Contributor
coco875
requested changes
Aug 31, 2026
Comment on lines
+71
to
77
| fn send_encoded_batch(&self, packets: Vec<EncodedPacket>) { | ||
| self.packets.lock().extend(packets); | ||
| } | ||
|
|
||
| fn send_encoded_bundle(&self, packets: Vec<EncodedPacket>) { | ||
| self.packets.lock().extend(packets); | ||
| } |
Comment on lines
+141
to
147
| fn send_encoded_batch(&self, packets: Vec<EncodedPacket>) { | ||
| (**self).send_encoded_batch(packets); | ||
| } | ||
|
|
||
| fn send_encoded_bundle(&self, packets: Vec<EncodedPacket>) { | ||
| (**self).send_encoded_bundle(packets); | ||
| } |
Comment on lines
+771
to
777
| fn send_encoded_batch(&self, _packets: Vec<EncodedPacket>) { | ||
| self.record_if_armed(); | ||
| } | ||
|
|
||
| fn send_encoded_bundle(&self, _packets: Vec<EncodedPacket>) { | ||
| self.record_if_armed(); | ||
| } |
Comment on lines
+187
to
193
| fn send_encoded_batch(&self, packets: Vec<EncodedPacket>) { | ||
| self.sent_packets.lock().extend(packets); | ||
| } | ||
|
|
||
| fn send_encoded_bundle(&self, packets: Vec<EncodedPacket>) { | ||
| self.sent_packets.lock().extend(packets); | ||
| } |
Comment on lines
+88
to
94
| fn send_encoded_batch(&self, packets: Vec<EncodedPacket>) { | ||
| self.sent_packets.lock().extend(packets); | ||
| } | ||
|
|
||
| fn send_encoded_bundle(&self, packets: Vec<EncodedPacket>) { | ||
| self.sent_packets.lock().extend(packets); | ||
| } |
Comment on lines
+127
to
133
| fn send_encoded_batch(&self, packets: Vec<EncodedPacket>) { | ||
| self.packets.lock().extend(packets); | ||
| } | ||
|
|
||
| fn send_encoded_bundle(&self, packets: Vec<EncodedPacket>) { | ||
| self.packets.lock().extend(packets); | ||
| } |
Contributor
There was a problem hiding this comment.
it's no the same as steel-core/benches/outbound_transport.rs ?
Contributor
|
hmm look like that your batch overlap with bundle that was made before and #545 also try something similar ? |
13 tasks
kdcokenny
marked this pull request as draft
September 2, 2026 18:52
|
This pull request has conflicts with the base branch "master". Please resolve those so we can test out your changes. |
Contributor
|
will you continue this PR and finish it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
Removes bottlenecks from encrypted play-state output without changing the packet bytes or order a Vanilla client receives.
Single packets still go out immediately, and batching never waits for future packets.
Release-mode encrypted loopback A/B results used fixed Linux CPU affinity, 20 samples, three-second measurements, and both benchmark orders:
In two paired 256-sample runs with another connection busy, batching reduced both median and 95th-percentile control-packet delay. The old path's tail varied widely, so this PR does not claim a fixed latency percentage.
How this was tested
Parity tests cover continuous CFB8 output, partial writes, pending flushes, absolute close deadlines, FIFO disconnect ordering, batch contiguity, writer handoff, and login encryption transitions.
All Steel Core, Steel Login, and Steel Protocol tests passed. The change was also validated with a Vanilla Minecraft 26.2 client on the latest Windows release.
Screenshots / logs
Not applicable.
Checklist