promotional bannermobile promotional banner
premium banner
Significantly speed up recipe search.

Description

latest version of this mod requires installation on both the client and server sides (except for the Fabric version).

This mod dramatically increases recipe lookup speed. Its core mechanism builds a tree index based on the hash codes of recipe ingredients, where ingredients serve as branches and recipes as nodes. When searching, it first extracts the ingredients from the container and starts matching from the root node; if a certain key does not match, it prunes that branch directly and no longer searches it, until a fully matching recipe is found. This greatly reduces the number of recipes that need to be checked. Compared to the vanilla method of comparing recipes one by one, it speeds up by more than 10 times, and the performance advantage becomes more significant as the total number of recipes increases.

Compatibility:

This mod is compatible with all mods that use the vanilla recipe manager for recipe searching. It is completely incompatible with Recipe Essentials (or FastSuite) because they optimize the same module. According to my test results, installing this mod alone achieves the best effect — it provides better optimization performance while ensuring compatibility.

Recipe Essentials relies on a caching mechanism (which often performs poorly), while FastSuite uses parallel processing (distributing the performance cost across multiple threads and potentially causing compatibility issues).

FastFurnace, FastWorkbench, Client Crafting are compatible.

Configuration:
Because some mods implement recipe-related interfaces in a non-standard way — for example, they implement the getIngredients method of the Recipe interface, so ingredients can be extracted and thus are optimized by this mod, but the corresponding Container interface does not implement the getItem method, making it impossible to search for that mod's recipes.

To address this issue, this mod by default only optimizes vanilla recipe types (crafting table, furnace, etc.). If you need better optimization, you can try turning off the "optimize_only_vanilla" option.

 

Performance Analysis

 

In vanilla:

  • Recipe searches are 8.36x to 85.95x faster
  • Most basic recipes see improvements between 8-40x
  • Failed matches are handled 28.11x faster

In ATM9 (heavy modpack):

  • The improvements become even more dramatic, ranging from 133.19x to 6942.47x faster
  • Basic recipes like sticks and crafting table see improvements of over 5000x
 

Test Result

Vanilla

[19:27:59] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 9130.97 ns to find the recipe for acacia planks [19:28:00] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 85468.055 ns to find the recipe for acacia planks Gap: 8.36x faster

[19:28:00] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 1149.77 ns to find the recipe for sticks [19:28:01] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 98866.69 ns to find the recipe for sticks Gap: 85.95x faster

[19:28:01] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 989.36 ns to find the recipe for crafting table [19:28:02] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 39704.348 ns to find the recipe for crafting table Gap: 40.14x faster

[19:28:02] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 7168.7905 ns to find the recipe for black shulker box [19:28:03] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 99736.78 ns to find the recipe for black shulker box Gap: 13.91x faster

[19:28:03] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 3845.24 ns to find the recipe for failed match [19:28:04] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 108064.26 ns to find the recipe for failed match Gap: 28.11x faster

 

ATM9

[20:05:20] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 36147.832 ns to find the recipe for acacia planks [20:06:48] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 8826844.0 ns to find the recipe for acacia planks Gap: 244.16x faster

[20:06:48] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 2543.54 ns to find the recipe for sticks [20:09:20] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 1.5240665E7 ns to find the recipe for sticks Gap: 5992.52x faster

[20:09:20] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 1175.53 ns to find the recipe for crafting table [20:10:42] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 8158714.5 ns to find the recipe for crafting table Gap: 6942.47x faster

[20:10:42] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 8131.2 ns to find the recipe for black shulker box [20:13:04] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 1.4163565E7 ns to find the recipe for black shulker box Gap: 1742.03x faster

[20:13:05] [Server thread/INFO] [fastrecipesearch/]: [Fast Test] - Took an average of 128783.62 ns to find the recipe for failed match [20:15:57] [Server thread/INFO] [fastrecipesearch/]: [Default Test] - Took an average of 1.7153812E7 ns to find the recipe for failed match Gap: 133.19x faster