跳到正文

Chionanthus

作者:Anthus

Optimizes networking and prevents common connection issues

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Chionanthus

Available on Fabric
Available on Modrinth
Available on GitHub

Overview

Chionanthus is a high-performance network optimization mod for Fabric that dramatically reduces bandwidth overhead and improves connection efficiency. Through intelligent packet batching, compression pooling, and adaptive flush strategies, Chionanthus optimizes Minecraft’s network layer without compromising compatibility or stability.

Features

Network Layer Optimizations

Intelligent Packet Batching

  • Consolidates multiple packets into single network operations
  • Reduces system call overhead compared to vanilla
  • Three adaptive flush strategies: Adaptive, Tick-Aligned, and Thread-Local

Advanced Compression Handling

  • Thread-local object pooling eliminates repeated Deflater/Inflater allocation
  • Buffer pooling reduces byte array allocations during compression
  • Configurable compression levels with hot-reload support

Optimized Packet Framing

  • Custom variable-length integer encoding/decoding
  • Reduced overhead in packet length encoding
  • Streamlined frame decoder and prepender implementations

Server List Performance

Dynamic Thread Pool Management

  • Adaptive thread pools that scale with server count
  • Prevents resource waste from vanilla’s fixed 50-thread pool
  • Intelligent timeout handling prevents UI freezes on unresponsive servers
  • Proper lifecycle management prevents thread leaks

Performance Monitoring

Built-in Metrics System

  • Tracks packet counts, compression ratios, and flush efficiency
  • Thread-specific flush pattern analysis
  • Optional debug logging at configurable intervals
  • Zero performance impact when disabled

Technical Details

To achieve its optimizations, Chionanthus:

  • Injects custom handlers into Netty pipelines during connection initialization
  • Replaces vanilla compression handlers with pooled, high-performance alternatives
  • Manages thread-local resource pools for lock-free, per-thread optimization
  • Uses atomic primitives for lock-free coordination in flush handlers

Flush Strategies

Adaptive Flush Handler
Dynamically adjusts batching based on current packet rate for optimal performance across varying network conditions.

Tick-Aligned Flush Handler
Batches packets per game tick (50ms intervals) for consistent, predictable network behavior.

Thread-Local Flush Strategy
Applies thread-specific thresholds optimized for render, server, and IO threads.

Thread Safety

All optimizations are designed with thread safety in mind:

  • ThreadLocal pooling provides lock-free per-thread instances
  • Atomic operations eliminate synchronization overhead
  • Proper volatile usage ensures visibility across threads

Configuration

Chionanthus provides extensive configuration options:

Network Settings

  • Maximum packet size: Configure packet size limit for mods and data packs with large data transfers
  • Compression level: Fine-tune compression
  • Flush consolidation: Toggle packet batching on/off
  • Flush strategy: Enable/disable Adaptive, Tick-Aligned, and Thread-Local strategies
  • Base flush threshold: Adjust batching aggressiveness
  • Max flush delay: Set latency cap in milliseconds

Server List Settings

  • Thread pool sizing: Minimum/maximum threads and overhead calculation
  • Thread keep-alive time: Control thread lifecycle
  • Pool recreation threshold: Prevent resource drift
  • Ping timeout: Prevent user interface freezes on unresponsive servers

Debug & Monitoring

  • Performance metrics: Optional detailed logging (performance impact when enabled)
  • Metrics interval: Configure logging frequency
  • Hot-reload: Apply configuration changes without restart (where supported)

Performance Impact

Flush Consolidation: Reduces from 1 syscall per packet to 1 syscall per batch

Compression Pooling: Eliminates allocation overhead by reusing pooled instances

Thread Pool Scaling: Dynamic sizing based on actual server list size vs vanilla’s fixed 50 threads

常见问题

Chionanthus 支持哪些 Minecraft 版本?

Chionanthus 支持 Minecraft Java 版 1.19–1.19.2,共 3 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

Chionanthus 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。

评论

登录后评论和评分

Anthus 的其他作品

查看全部 →