[PR #1204] [MERGED] Furnaces: look up the cooking recipe in an index, without cloning it #3418

Closed
opened 2026-11-03 04:09:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1204
Author: @pirut
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ludovic111

Base: main ← Head: claude/upstream-furnaces


📝 Commits (1)

  • 62874d8 Furnaces: look up the cooking recipe in an index, without cloning it

📊 Changes

2 files changed (+97 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/containers.rs (+1 -1)
📝 crates/horizon-client/src/crafting.rs (+96 -0)

📄 Description

Requested by JR

What and why

Furnaces: look up the cooking recipe in an index, without cloning it

Every lit furnace, smoker and blast furnace called Recipes::cook each
tick, which scanned all cooking recipes (string compares and hash
lookups) and the furnace then cloned the recipe found, its ingredient's
item set included. Recipes now keeps, built at the first lookup, the
first recipe of each kind for each item, which is what the scan
returned; the furnace borrows it.

1000 lookups over 320 recipes: 2.07 -> 0.08 ms

Vanilla reference

AbstractFurnaceBlockEntity.serverTick's recipe lookup: the index returns the first matching recipe of each kind, which is what the scan returned. Harnesses: test_recipe_parity.py, test_block_entity_tickers_parity.py.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on Mac, against upstream/main at fd0473605, 1 min 23 s)

Check Result
Scope ✅ 2 files, +97 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (4 s)
clippy ✅ (16 s)
tests: horizon-client ✅ 1081 passed (57 s)
doc tests ✅ 0 passed (5 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1204 **Author:** [@pirut](https://github.com/pirut) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `claude/upstream-furnaces` --- ### 📝 Commits (1) - [`62874d8`](https://github.com/horizon-rust/horizon/commit/62874d8dc43d131c93b2800a767e68f37b0b4be6) Furnaces: look up the cooking recipe in an index, without cloning it ### 📊 Changes **2 files changed** (+97 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/containers.rs` (+1 -1) 📝 `crates/horizon-client/src/crafting.rs` (+96 -0) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"pirut"} --> _Requested by **JR**_ ## What and why Furnaces: look up the cooking recipe in an index, without cloning it Every lit furnace, smoker and blast furnace called Recipes::cook each tick, which scanned all cooking recipes (string compares and hash lookups) and the furnace then cloned the recipe found, its ingredient's item set included. Recipes now keeps, built at the first lookup, the first recipe of each kind for each item, which is what the scan returned; the furnace borrows it. ``` 1000 lookups over 320 recipes: 2.07 -> 0.08 ms ``` ## Vanilla reference `AbstractFurnaceBlockEntity.serverTick`'s recipe lookup: the index returns the first matching recipe of each kind, which is what the scan returned. Harnesses: `test_recipe_parity.py`, `test_block_entity_tickers_parity.py`. ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on Mac, against upstream/main at fd0473605, 1 min 23 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +97 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (4 s) | | clippy | ✅ (16 s) | | tests: horizon-client | ✅ 1081 passed (57 s) | | doc tests | ✅ 0 passed (5 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3418
No description provided.