Tom’s Simple Storage performance optimization
Fixed performance issues with Tom's Simple Storage
介绍
Tom’s Simple Storage performance optimization
Minecraft 1.20.1 · Forge · requires Tom’s Simple Storage 1.7.1+
This mod adds no content of its own. It is two hooks into Tom’s Simple Storage’s own classes, and it does nothing without it. Both changes remove repeated work and leave every result identical.
Opening a storage terminal rescans the whole network every server tick. The menu’s broadcastChanges() runs once per tick while a screen is open, and getStacks() sets the “items changed” flag every time it is called. updateServer() then clears the item index and re-reads every slot of every connected container. The flag is set by a reader, so “rescan when dirty” becomes “rescan every tick while the screen is open”. It is now set once every 10 ticks by default (configurable), which makes the list on screen up to half a second stale — a display refresh, not a transaction, so nothing can be duplicated or lost. Loading and linking an inventory are untouched and still rescan immediately.
The flat slot number is found with a linear scan. Every linked container shares one flat numbering, but only their sizes are kept, so getStackInSlot(slot) subtracts those sizes one at a time — O(containers) per lookup. The terminal walks every slot to rebuild its list, which makes one rebuild O(containers²): roughly 11,000 steps with 20 containers, 270,000 with 100. A prefix-sum array and a binary search now locate the container instead — the same method Forge’s own CombinedInvWrapper uses — taking a rebuild to O(containers × log containers). The container and the local slot handed to it are identical to what the scan produced, so the item list is unchanged. Networks of 8 containers or fewer keep the original code path.
Config — config/tomsstorageperformanceoptimization-common.toml: enabled, throttleRescan, rescanIntervalTicks, fastSlotLookup. Setting enabled = false restores stock behaviour completely; each switch also works on its own.
常见问题
Tom’s Simple Storage performance optimization 支持哪些 Minecraft 版本?
Tom’s Simple Storage performance optimization 支持 Minecraft Java 版 1.20.1,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。
Tom’s Simple Storage performance optimization 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
anderlyer 的其他作品
查看全部 →Ice and Fire — Ultimate Optimization
Greatly optimized the performance issues of Ice and Fire.
Ars Nouveau Performance Optimization
A performancemod for Ars Nouveau
Alex’s Mobs and Caves Optimization
Optimizes both Alex's Caves and Alex's Mobs; works even if only one of them is installed.
Multithreading Maid
Let your maid handle multiple types of tasks with a single command.
评论
登录后评论和评分