Fast Recipe Search

Quick rating

Community listing page, reviews here may not be monitored by the author.

Fast Recipe Search

By nutant233Owner

No reviews yet

Significantly speed up recipe search.

Mod Loaders
Minecraft

About

Description

🚀 What is Fast Recipe Search?

Fast Recipe Search dramatically increases recipe lookup speed. Its core mechanism builds a tree index based on the hash codes of recipe ingredients — ingredients serve as branches and recipes as nodes. When searching, it extracts the ingredients from the container and starts matching from the root node; if a key does not match, it prunes that whole branch immediately. This greatly reduces the number of recipes that need to be checked.

Compared to the vanilla method of comparing recipes one by one, it is more than 10x faster, and the advantage grows as the total number of recipes increases. In heavy modpacks the speedup is even more dramatic.

The mod's core library also provides a high-performance Recipe Tree API that other mods can call. It does not depend on Minecraft code, so even non-MC projects can use it.

📊 Performance

This mod vs Vanilla

  • Recipe searches are 8.36x to 85.95x faster in vanilla
  • Failed matches are handled 28.11x faster
  • In ATM9 (heavy modpack): 133x to 6942x faster
  • Basic recipes like sticks and crafting tables improve by over 5000x in modpacks

✅ Compatibility

  • Compatible with all mods that use the vanilla recipe manager for recipe searching
  • FastFurnace, FastWorkbench, Client Crafting — compatible
  • Optimizes both the client and server sides
  • Incompatible: Recipe Essentials / FastSuite — they optimize the same module. Installing this mod alone gives the best result.

🛠 Installation

  1. Download the latest release jar
  2. Put it into your instance's mods folder
  3. Start the game — no further setup is needed, the mod optimizes recipe search automatically

⚙️ Configuration

The config file is config/fast_recipe_search.toml. An existing fast_recipe_search.properties is migrated automatically. Changes take effect after restarting the game.

By default only vanilla recipe types are optimized. Recipe types that are incompatible (e.g. the mod's Container does not implement getItem) can be excluded, and individual recipe classes can be whitelisted/blacklisted for indexing.

[optimize_type]
# all | vanilla | whitelist | blacklist
mode = "whitelist"
whitelist = ["minecraft:crafting", "minecraft:smelting"]
[recipe_class]
# Index vanilla classes plus one mod recipe
mode = "whitelist"
whitelist = ["vectorwing.farmersdelight.common.crafting.CookingPotRecipe"]
  • optimize_type.mode — scope of recipe types to optimize
  • optimize_type.whitelist / blacklist — recipe type ids (e.g. "minecraft:crafting")
  • recipe_class.mode — scope of recipe classes to index
  • recipe_class.whitelist / blacklist — class names, or package prefixes ending with .

👨‍💻 For Developers

The bundled RecipeSearch library (com.gto.recipesearch) provides a high-performance recipe tree API that does not depend on Minecraft code. Mods with custom Ingredient subclasses can register a hash extractor so their ingredients can be indexed:

Fastrecipesearch.registerCustomIngredientAction(MyIngredient.class, (ingredient, consumer) -> {
    // For each matching item, call: consumer.accept(item, hash);
});

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

 

This mod significantly accelerates recipe lookup. Its mechanism involves building a tree based on hash codes of recipe ingredients, enabling rapid identification during searches. Compared to the original method of matching recipes one by one, it achieves a speedup of over 10 times, with the performance gap widening as the total number of recipes increases. Furthermore, the mod Core library provides a high-performance recipe tree API. Other mods can also utilize this library, and since it doesn't rely on Minecraft code, even non-Minecraft projects can use it.