Speedups 配置(SpeedupsConfig)
基本信息
| 属性 | 值 |
|---|---|
| 配置类 | com.mitchej123.hodgepodge.config.SpeedupsConfig |
| 配置分类 | speedups(@Config(modid = "hodgepodge", category = "speedups"),SpeedupsConfig.java:7) |
| 源文件 | src/main/java/com/mitchej123/hodgepodge/config/SpeedupsConfig.java |
| 字段总数 | 52(全部为 public static) |
| 分组数 | 6(含一对 region / endregion 标记) |
| 配置文件 | config/hodgepodge.cfg 的 S:speedups 段 |
| GUI 可见 | 是(列于 config/gui/HodgepodgeGuiConfig.java:27) |
| 挂载的 Mixin 数 | 48(Mixins.java 中 .setApplyIf(() -> SpeedupsConfig.*) 出现 48 次) |
功能
本类全部是性能优化开关。与 TweaksConfig 的界线是:这里只改「怎么算 / 怎么缓存 / 怎么传输」,不改玩家可感知的手感默认值。
区块生成调度
speedupsConfig 中最完整的一块是 throttleChunkGeneration 及其配套参数(SpeedupsConfig.java:116-159)——把区块生成摊平到多个 tick 执行,以时间预算 + 每玩家配额 + 欠债摊销三种机制控制服务器卡顿:
maxChunkGenPerPlayerPerTick/chunkGenBudgetMs:硬预算amortizeChunkGenOverruns(AmortizeMode枚举):超额后记账欠债、跳过生成直到还清forcePopulateAgeTicks:无论预算多紧,可见区块空洞最多等这么久就会强制处理
实体封包批处理
源码注释 // I split these in two so that you can disable batching at runtime to diagnose problems(SpeedupsConfig.java:198)明确说明:batchDescriptionPacketsMixins(需重启,注册 Mixin)与 batchDescriptionPacketsCode(不需重启)被刻意拆成两项,便于出问题时单独关闭。
数值
按分组统计
分组(源码 // 注释) |
字段数 |
|---|---|
region Minecraft |
36 |
| I split these in two so that you can disable batching at runtime… | 10 |
| Biomes O’ Plenty | 3 |
| VoxelMap | 1 |
| IC2 | 1 |
| Thaumcraft | 1 |
区块生成调度参数
| 配置项 | 类型 | 默认值 | 含义 |
|---|---|---|---|
maxChunkGenPerPlayerPerTick |
int |
1 | 每玩家每 tick 最多延迟生成的区块数 |
chunkGenBudgetMs |
int |
4 | 每 tick 区块生成时间预算(毫秒) |
forcePopulateAgeTicks |
int |
600 | 可见区块空洞被强制处理前的等待 tick 数 |
amortizeChunkGenOverruns |
AmortateMode 枚举 |
false 对应的默认分支 |
何时对区块生成超时做欠债摊销 |
preventEntityChunkLoading |
boolean |
true | 阻止实体 tick 与随机 tick 触发区块生成 |
maxSendSpeed |
int |
8 | 每玩家每 tick 发送区块上限(仅 fastChunkHandling 生效) |
maxUnloadSpeed |
int |
8 | 每玩家每 tick 卸载区块上限(仅 fastChunkHandling 生效) |
其它可调数值
| 配置项 | 类型 | 默认值 | 含义 |
|---|---|---|---|
chunkCompressionLevel |
int |
Deflater.DEFAULT_COMPRESSION |
存档区块压缩级别 |
batchDescriptionBlacklist |
String[] |
空 | 实体封包批处理黑名单(全限定类名,不需重启) |
cullDistantItemFrameContents |
隐含 | 64 / 96 | 距展示框 >64 格跳过内容渲染,整框 >96 格跳过渲染(SpeedupsConfig.java:20) |
明细
以下为 SpeedupsConfig.java 的全部 52 个字段,按源码 // 分节排列。
region Minecraft
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
fastItemEntityPhysics |
boolean |
true | hodgepodge speedups Improves the performance of items significantly by not checking collisions against other entities for them. (Adapted from FalseTweaks) |
cullDistantItemFrameContents |
boolean |
true | Skip rendering item frame contents farther than 64 blocks and entire frames farther than 96 blocks |
optimizeASMDataTable |
boolean |
true | Optimize ASMDataTable getAnnotationsFor for faster startup |
optimizeJarDiscovererRegexOverhead |
boolean |
true | Reduce regex overhead when scanning jar entries for class files during FML mod discovery |
optimizeTextureLoading |
boolean |
true | Optimize texture loading |
optimizeTileentityRemoval |
boolean |
true | Optimize tileEntity removal in World.class |
speedupChunkCoordinatesHashCode |
boolean |
true | Speedup ChunkCoordinates hashCode |
preventLoadingChunksWhenTickingBlocks |
boolean |
true | Prevents Vanilla blocks from loading chunks when ticking\n Cocoa, Crop, Fire, Grass, Vine, Farmland, Mushroom, Mycelium, Sapling, Stem, Torch |
preventLoadingChunksWhenLiquidsFlow |
boolean |
true | Prevents flowing liquids from loading chunks |
preventLoadingChunksWhenPathfinding |
boolean |
true | Prevents Vanilla entities from loading chunks when pathfinding |
speedupVanillaFurnace |
boolean |
true | Speedup Vanilla Furnace recipe lookup |
tcpNoDelay |
boolean |
true | Sets TCP_NODELAY to true, reducing network latency in multiplayer. Works on server as well as client. From makamys/CoreTweaks |
speedupChunkProviderClient |
boolean |
true | Speeds up ChunkProviderClient by removing chunkListing. Note: Depends on asm.speedupLongIntHashMap |
fastRandom |
boolean |
true | Replaces uses of java.util.Random with a faster version, skipping atomic operations. |
fastIntCache |
boolean |
false | Rewrites internal cache methods to be safer and faster. Experimental, use at your own risk! |
unboxMapGen |
boolean |
true | Replaces a boxed primitive map in MapGenStructure with the fastutil equivalent, to reduce allocations. |
speedupLeafDecay |
boolean |
true | BFS leaf decay with early exit on nearby logs, replacing vanilla’s full scan |
asyncIconLoading |
boolean |
false | Load texture map icons on multiple threads |
removeExtraIconLoad |
boolean |
false | Remove icon loading on texture map init |
skipUselessFallingBlockTicks |
boolean |
true | Skip scheduling falling block ticks when the block below is solid |
speedupPendingTickLookup |
boolean |
true | Spatial index for pending block updates, accelerates chunk saving and unloading |
speedupChunkUnload |
boolean |
true | Optimized chunk unloading with fastutil collections and batched removal |
throttleChunkGeneration |
boolean |
true | Spread chunk generation across ticks to reduce server stalls when players move through ungenerated terrain. |
maxChunkGenPerPlayerPerTick |
int |
4 | Maximum deferred chunk generations per player per tick. Higher values fill terrain faster but increase per-tick lag from worldgen. [Requires throttleChunkGeneration] |
chunkGenBudgetMs |
int |
20 | Time budget in milliseconds for chunk generation per tick. Actual budget is min(this, remaining tick time to 50ms). Generation is skipped when recent operations suggest the budget would be exceeded. 0 = no time limit (count-based only). [Requires throttleChunkGeneration] |
preventEntityChunkLoading |
boolean |
true | Prevent entity ticks and random ticks from triggering chunk generation. Missing chunks return empty air blocks during blocked phases; the scheduler loads them shortly after. [Requires throttleChunkGeneration] |
amortizeChunkGenOverruns |
AmortizeMode |
“DedicatedServerOnly” | When to amortize chunk generation overruns by tracking time debt and skipping generation until the debt is paid down. Smooths out server tick times when single chunks exceed the time budget. DedicatedServerOnly enables on multiplayer servers but not singleplayer/LAN. [Requires throttleChunkGeneration] DedicatedServerOnly |
forcePopulateAgeTicks |
int |
100 | Ticks before a visible chunk hole is force-processed regardless of budget. Only applies to chunks within view distance of a player. 0 = disabled. |
fastChunkHandling |
boolean |
false | Removes hard caps on chunk sending and unloading speed. Experimental and probably incompatible with hybrid servers! |
maxSendSpeed |
int |
50 | The maximum speed of chunkloading per player, in chunks/tick. High values may overload clients! Only active with fastChunkHandling.\n For reference: Vanilla is 5, or 100 chunks/sec. At 32 render distance = 4225 chunks, loading the world would take 42.25 seconds. |
maxUnloadSpeed |
int |
220 | The maximum speed of chunk unloading, in chunks/tick. High values may overload servers! Only active with fastChunkHandling.\n For reference: Vanilla is 100, or 2000 chunks/sec. At 32 render distance = 4225 chunks, unloading the world would take 2.1125 seconds. |
fastBlockLookup |
boolean |
true | Accelerate Block.getBlockById() and Block.getIdFromBlock(). |
optimizeMobSpawning |
boolean |
true | Optimize mob spawning |
limitMobSpawningToViewDistance |
boolean |
true | Limit mob spawning to the view distance |
skipSpawningWithPendingLight |
boolean |
true | Skip mob spawning in chunks with pending lighting updates (requires Supernova) |
speedupRemoveFormatting |
boolean |
true | Speed up the vanilla method to remove formatting codes |
I split these in two so that you can disable batching at runtime to diagnose problems
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
batchDescriptionPacketsMixins |
boolean |
true | Batch Tile Entity Description S35PacketUpdateTileEntity Packets (Enables Mixins, Requires Restart) |
batchDescriptionPacketsCode |
boolean |
false | Batch Tile Entity Description S35PacketUpdateTileEntity Packets (Enables Code, Does not require restart) |
batchDescriptionBlacklist |
String[] |
{} | Tile Entity Packet Batching Blacklist (Fully Qualified Class Names, Does not require restart) |
directTileEntityArraySerialization |
boolean |
true | Transfer S35PacketUpdateTileEntity array buffers directly without NBT. The NBT contained in S35PacketUpdateTileEntity must be of the format {[one character]: [byte array]} (e.g. {“X”: [B;0b, 1b]}) for this to apply for a given TileEntity. |
poolZlibInstances |
boolean |
true | Pool Inflater/Deflater instances for NBT compression to reduce native cleanup overhead |
speedupChunkCompression |
boolean |
true | Optimize chunk compression with reused deflater and batched writes |
chunkCompressionLevel |
int |
Deflater.DEFAULT_COMPRESSION | Compression level for chunk saving. =default, =none, =fastest, =smallest. |
asyncBatchedNBTParsing |
boolean |
true | Parse batched tile entity NBT asynchronously on the client |
optimizeWavefrontObjectModelLoading |
boolean |
true | Reduce regex overhead when loading object models |
optimizeResourcePackPath |
boolean |
true | Avoid String.format overhead when resolving resource pack paths |
Biomes O’ Plenty
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
speedupBOPFogHandling |
boolean |
true | Speedup biome fog rendering in BiomesOPlenty |
speedupBOPEntityPixie |
boolean |
true | Use fast atan2 approximation for BOP Pixie entity yaw calculation |
speedupBOPBiomeDecoration |
boolean |
true | Cache allocations in BOP biome decoration to avoid per-chunk object creation and reflection |
VoxelMap
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
replaceVoxelMapReflection |
boolean |
true | Replace reflection in VoxelMap to directly access the fields instead. |
IC2
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
speedupIC2ReactorSize |
boolean |
true | Speedup IC2 reactor size computation |
Thaumcraft
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
speedupThaumGetInfusionRecipes |
boolean |
true | Speedup ThaumcraftApi#getInfusionRecipes |