关于
FastSuite 提升了所有使用 JSON 配方系统的模组的配方匹配性能,而非仅针对特定子集的配方。其方法在不同大版本中有所变化——当前实现(7.0.0+)使用了基于索引的算法。
方法
在其生命周期中,FastSuite 曾使用过三种不同的策略:
列表重排序 (4.0.0 及更早版本) — 配方存储在一个“置顶移动”列表中,因此频繁访问的配方向前迁移,并在后续查找中变得更容易找到。首次访问时匹配速度与原版相同;对深层配方的后续访问速度提升超过 95%,而对已靠近列表顶部的配方影响很小。
并发匹配 (4.1.0 – 6.x) — 对于拥有超过 100 个配方的任何配方类型,匹配过程分布在多个线程上而不是单个线程。这在 All The Mods 8 中实现了 10x–12x 的速度提升,并且比重排序模型更具兼容性且更稳定(例如,它与 Polymorph 兼容,并且在第一次匹配时即可工作)。
索引匹配 (7.0.0+) — 当前的方法完全放弃了并发处理,转而采用基于索引的算法。配方被建立索引,以便只测试可行的候选项,而不是扫描整个列表。这使得输入的所有配方匹配速度比原版快约 2x–4.5 倍,无需多线程且无每次匹配的数据写入:
[Indexed] - 匹配所有 acacia planks 的配方平均耗时 93541.68 ns
[Vanilla] - 匹配所有 acacia planks 的配方平均耗时 416312.28 ns
[Indexed] - 匹配所有 sticks 的配方平均耗时 203072.3 ns
[Vanilla] - 匹配所有 sticks 的配方平均耗时 523836.38 ns
[Indexed] - 匹配所有 crafting table 的配方平均耗时 104967.54 ns
[Vanilla] - 匹配所有 crafting table 的配方平均耗时 236834.45 ns
[Indexed] - 匹配所有 black shulker box 的配方平均耗时 212810.42 ns
[Vanilla] - 匹配所有 black shulker box 的配方平均耗时 453240.12 ns
[Indexed] - 匹配所有失败匹配的配方平均耗时 243105.69 ns
[Vanilla] - 匹配所有失败匹配的配方平均耗时 918821.25 ns
如果你在想“嘿,等等,4.0.0 - 6.0.0 的那些数字听起来更好”,嗯,原版的改进使得这些优势减弱到了几乎与单线程匹配相当的程度。现在的基线速度已经快得多,但索引技术仍然可以做得更好。
兼容性
本模组设计为非侵入式,应能与所有其他模组配合使用,除非有其他模组也替换了配方管理器。它兼容 KubeJS 和 CraftTweaker 等配方修改模组,并且不会与 JEI 产生任何问题。
FastSuite 并不替代 FastWorkbench 或 FastFurnace,尽管安装它们后其带来的好处会有所减少,因为部分工作已交由 FastSuite 处理。为了获得最佳的配方性能,我仍然建议同时安装这三者。
支持我
联系方式
Discord:
About
FastSuite improves recipe matching performance for every mod that uses the JSON recipe system, rather than a specific subset of recipes. Its approach has changed across major versions — the current implementation (7.0.0+) uses an index-based algorithm.
Approaches
FastSuite has used three different strategies over its lifetime:
List Reordering (4.0.0 and older) — Recipes were stored in a move-to-front list, so frequently-accessed recipes migrated toward the front and became cheaper to find on subsequent lookups. First access matched vanilla speed; later accesses to deep recipes improved by >95%, with little impact on recipes already near the front.
Concurrent Matching (4.1.0 – 6.x) — For any recipe type with more than 100 recipes, matching was spread across multiple threads instead of one. This produced a 10x–12x speedup in All The Mods 8, and was more compatible and less brittle than the reordering model (e.g. it worked with Polymorph and on the first match).
Indexed Matching (7.0.0+) — The current approach drops concurrency entirely in favor of an index-based algorithm. Recipes are indexed so that only viable candidates are tested, rather than scanning the full list. This matches all recipes for an input roughly 2x–4.5x faster than vanilla, with no threading and no per-match data writes:
[Indexed] - Took an average of 93541.68 ns to match all recipes for acacia planks
[Vanilla] - Took an average of 416312.28 ns to match all recipes for acacia planks
[Indexed] - Took an average of 203072.3 ns to match all recipes for sticks
[Vanilla] - Took an average of 523836.38 ns to match all recipes for sticks
[Indexed] - Took an average of 104967.54 ns to match all recipes for crafting table
[Vanilla] - Took an average of 236834.45 ns to match all recipes for crafting table
[Indexed] - Took an average of 212810.42 ns to match all recipes for black shulker box
[Vanilla] - Took an average of 453240.12 ns to match all recipes for black shulker box
[Indexed] - Took an average of 243105.69 ns to match all recipes for failed match
[Vanilla] - Took an average of 918821.25 ns to match all recipes for failed match
If you're thinking "hey wait those numbers from 4.0.0 - 6.0.0 sound better", well, changes in vanilla diminished those to the point where concurrent matching was almost equivalent to single-threaded matching. The baseline is much faster now, but indexing can still do quite a bit better.
Compatibility
This mod is made to be non-intrusive and should work with all other mods, short of another mod also replacing the recipe manager. It is compatible with recipe modification mods such as KubeJS and CraftTweaker, and causes no issues with JEI.
FastSuite does not replace FastWorkbench or FastFurnace, though their benefits will be lessened if it is installed, since some of the work is offloaded to FastSuite. For maximum recipe performance I still advise installing all three.
Support Me
Contact
Discord:
评论 0
登录后参与评分
还没有评论,来抢沙发吧