You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MC 1.21.6 targets Java 21. This change breaks build compatibility for everyone not running a Java 25 toolchain. It's also completely unrelated to the PR title ("tune aggressive compression with smoothness guards"). Was this intentional or accidental? Either way it needs to be dropped.
Default values — do you have benchmarks?
Parameter
Old
New
compressionLevel
6
10
contextLevel
23
25
aggregationMinBatchPackets
4
6
aggregationMaxExtraCycles
2
1
compressionLevel 6→10 significantly increases CPU cost per packet. contextLevel 23→25 quadruples per-connection memory (8MB→32MB). What testing showed these are better defaults?
minBatchPackets raised to 6 but maxExtraCycles dropped to 1 — these work against each other. Higher batch threshold + shorter wait = more packets sent unbatched. What's the rationale?
Config getter in hot path
The old code used static final constants for MIN_BATCH_PACKETS and MAX_EXTRA_CYCLES. Now NotEnoughBandwidthConfig.get() (which calls ConfigHelper.getConfigRead()) runs every 50ms flush tick and every write() call. On a server with many connections this adds up. If these need to be configurable, cache the values rather than calling get() on every invocation.
chunkCacheCompressionLevel upper bound
The clamp allows up to 19. Zstd level 19 is extremely slow — chunk cache writes happen on the player's receive path, so high levels will cause noticeable stutter. Consider capping at 12, or at minimum document the cost of high values.
Compression savings check — good idea, needs cleanup
The logic to check whether compression actually saves enough bytes before using it is sound, and the wire format stays compatible. However, the shouldTryCompress=false path and the shouldTryCompress=true && useCompressed=false path produce identical output — they could be unified to reduce nesting.
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
invalidThis doesn't seem rightquestionFurther information is requested
2 participants
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.
No description provided.