promotional bannermobile promotional banner

Just Enough Threads [JEI Startup Optimize]

Speeds up JEI startup by moving its heaviest work off the main thread and across CPU cores.

Just Enough Threads

Get into your world faster. Just Enough Threads moves JEI's heaviest startup work off the main thread and spreads it across your CPU cores, so large modpacks stop freezing on the loading screen while JEI builds its search index.

What it does

Responsive JEI startup

JEI startup runs on one dedicated background thread in JEI's original order, so the game keeps rendering while recipes and the runtime are built. Plugin callbacks never run concurrently. Plugins that need the main thread, the final onRuntimeAvailable callbacks and the runtime publication return to the client thread. Leaving the world, a connection timeout or a server shutdown cancels the build, so a stale runtime is never published into the next world.

Budgeted ingredient search index

JEI normally builds its ingredient filter — the search index over every item and fluid — on the main thread while you wait on the loading screen. In a big pack that can take several seconds. Just Enough Threads fills it in small steps on client ticks after you enter the world, shows the progress in the inventory, and refreshes the sidebar once when the index is complete.

What you will see: the JEI item list appears a moment after you spawn, instead of holding up world load.

Experimental recipe ingredient pre-resolution

Before JEI can inspect its built-in recipes (crafting, smelting, stonecutting, and more), every ingredient tag has to be resolved into a concrete list of items. Minecraft does that lazily and JEI triggers all of it during startup. Just Enough Threads does the resolution across CPU cores up front, then hands back to JEI. JEI's own validation and registration still run exactly as they normally do, on the main thread, just against data that is already resolved.

This option is off by default because custom recipes and lazy ingredient caches are not always safe to access from worker threads. It remains available for controlled testing on a specific pack.

Compact generated anvil and grindstone recipes

Generating every item and enchantment combination for the anvil can take minutes in very large packs. Just Enough Threads keeps a compact representative set instead: every applicable enchantment stays visible on up to three item families, with up to 16 repair examples; grindstone examples are trimmed the same way on JEI versions that generate them. Set disableAnvilRepairRecipes = true or disableAnvilEnchantRecipes = true to hide a whole class of generated anvil recipes.

Performance

An early measurement from version 0.2.0 (July 2026), in a large modpack (roughly 21,000 items and fluids and 34,000 vanilla-type recipes), entering the same world on the same machine with the optimizations off vs on:

JEI startup Off On
Building runtime 5.18 s 0.55 s
Starting JEI (total) 10.7 s 6.4 s

Later versions moved JEI startup to a dedicated thread and the index build to client ticks, so current numbers differ. Numbers vary with hardware and pack size.

Configuration

Config file: config/justenoughthreads-client.toml. Every optimization can be toggled independently. The legacy jei_optimize-client.toml is copied automatically when the new file is absent.

  • enabled — master switch for the whole mod.
  • asyncStartup — build JEI serially on a dedicated background thread, then run configured plugins, runtime callbacks, and publication on the client thread; world exit, timeout, and server shutdown cancel stale work immediately.
  • mainThreadPlugins — JEI plugin IDs that must use the client thread. The defaults cover Alex's Caves, Experience Obelisk, Collector's Reap, Theurgy, and Productive Trees. Add modid:path for one plugin or modid for all plugins from a mod.

JEI's own creative-tab enumeration and GUI runtime construction always stay on the client thread; they do not need entries in this list.

  • asyncIngredientFilter — fill the ingredient search index in small steps on client ticks, then publish the sidebar once.
  • parallelVanillaRecipes — experimental recipe ingredient pre-resolution; disabled by default.
  • optimizeAnvilRepresentatives — keep the compact representative anvil examples; enabled by default.
  • disableAnvilRepairRecipes / disableAnvilEnchantRecipes — hide all generated anvil recipes of that class; disabled by default.

If you ever run into a problem on world entry, turn off the individual options, or set enabled = false to fully restore stock JEI behavior.

Requirements

Minecraft Loader JEI (checked releases)
1.20.1 Forge 47.4.4+ 15.20 - 15.74
1.21.1 NeoForge 21.1.x 19.27 - 19.70
26.1.2 NeoForge 26.1.2.109+ 29.43 - 29.53

Client-side only. The 26.1.2 build needs Java 25.

Just Enough Threads

更快进入世界。 Just Enough Threads 把 JEI 启动时最重的工作移出主线程、分散到多个 CPU 核心,让大型整合包在加载界面上不再因为 JEI 构建搜索索引而卡住。

功能

分批构建物品搜索索引

JEI 默认在主线程上构建物品筛选器——也就是覆盖所有物品与流体的搜索索引——而你只能在加载界面干等。在大型整合包里,这一步要好几秒。Just Enough Threads 会在你进入世界之后,利用每个客户端 tick 的一小段时间分批填充索引,在物品栏里显示进度,全部完成后一次性刷新侧栏。

你会看到: JEI 物品列表在你进入世界后稍等片刻才出现,而不是拖慢世界加载。

保持界面响应的串行 JEI 启动

asyncStartup 会在一条专用后台线程上按 JEI 原顺序构建配方与 runtime。插件回调不会并发执行;mainThreadPlugins 中的插件、最终的 onRuntimeAvailable 回调和 runtime 发布会返回客户端线程,以兼容 JEI 仅允许在主线程调用的 API。退出世界、连接超时或服务器关闭时,当前 generation 会立即失效,启动线程和派生任务会被取消,旧 runtime 不会发布到下一个世界。

实验性并行预解析配方材料

JEI 在检查内置配方(合成、熔炼、切石等)之前,需要先把每一条材料标签解析成具体的物品列表。Minecraft 采用惰性解析,而 JEI 启动时会把这些解析全部触发一遍。Just Enough Threads 提前用多个 CPU 核心完成这项解析,再交回 JEI。JEI 自身的校验与注册照常在主线程上运行,只是读到的数据已经解析完毕。

此选项默认关闭,因为自定义配方与惰性材料缓存不一定能安全地从工作线程访问。它仍可用于针对特定整合包的受控测试。

精简自动生成的铁砧与砂轮配方

在超大型整合包中,枚举所有物品与附魔的铁砧组合可能耗时数分钟。Just Enough Threads 改为保留一组有代表性的示例:每种可用附魔仍会出现在最多三类物品上,另保留最多 16 个修复示例;生成砂轮配方的 JEI 版本也按同样方式精简。将 disableAnvilRepairRecipes = true 或 disableAnvilEnchantRecipes = true 可以隐藏整类自动生成的铁砧配方。

性能

以下是 0.2.0 版本(2026 年 7 月)的早期测量,在一个大型整合包(约 21,000 个物品/流体、34,000 条原版类配方)中,于同一台机器进入同一世界,关闭 vs 开启优化:

JEI 启动阶段 关闭 开启
Building runtime 5.18 s 0.55 s
Starting JEI(总计) 10.7 s 6.4 s

之后的版本把 JEI 启动移到专用线程、把索引构建改为按客户端 tick 分批进行,当前数字会有所不同。具体数字随硬件与整合包规模而变化。

配置

配置文件:config/justenoughthreads-client.toml。每一项优化都可以单独开关。若新文件不存在,会自动从旧的 jei_optimize-client.toml 复制配置,且不会删除旧文件。

  • enabled — 整个 mod 的总开关。
  • asyncStartup — 在专用后台线程上串行启动 JEI;退出世界、连接超时或服务器关闭时立即取消,默认开启。
  • mainThreadPlugins — 必须在客户端主线程执行的 JEI 插件 ID 列表。默认包含 Alex's Caves、Experience Obelisk、Collector's Reap、Theurgy 和 Productive Trees。填写 modid:path 可匹配单个插件,只填写 modid 可匹配该模组的全部插件。

JEI 自身的创造栏枚举和 GUI runtime 构建始终保留在客户端主线程,无需加入该列表。

  • asyncIngredientFilter — 进入世界后按客户端 tick 分批填充物品搜索索引,完成后一次性发布侧栏。
  • parallelVanillaRecipes — 实验性并行预解析配方材料;默认关闭。
  • optimizeAnvilRepresentatives — 保留精简的代表性铁砧示例;默认开启。
  • disableAnvilRepairRecipes / disableAnvilEnchantRecipes — 隐藏该类全部自动生成的铁砧配方;默认关闭。

如果进入世界时遇到任何问题,可以逐项关闭这些选项,或将 enabled = false 以完全恢复 JEI 的原生行为。

需求

Minecraft Loader JEI(已检查的版本)
1.20.1 Forge 47.4.4+ 15.20 - 15.74
1.21.1 NeoForge 21.1.x 19.27 - 19.70
26.1.2 NeoForge 26.1.2.109+ 29.43 - 29.53

仅客户端需要安装。 26.1.2 版本需要 Java 25。

Just Enough Threads [JEI Startup Optimize] Team

profile avatar
  • 8
    Followers
  • 22
    Projects
  • 315.9K
    Downloads

More from tonywww4View all