Skip to content

Conversation

@TechLord22
Copy link
Member

@TechLord22 TechLord22 commented Sep 27, 2025

What

Adds recipes into the trie in a two-phase system. This will reduce memory usage and provide a minor speed boost to recipe searching. It reduces memory usage by flattening all of the recipe inputs, and sorting them by frequency, then using that frequency index to sort each recipe's inputs and add them in sorted order. This means the biggest nodes will be at the root of the trie and the leaves will be the smallest, instead of an even distribution. This will lower the size of the maps overall in the trie by compacting all occurrences of ingredients into the same condensed region within the datastructure.

Implementation Details

I refactored and significantly cleaned up GTRecipeLookup. It is now called RecipeDB. I stopped exposing most of the internal implementation details of GTRecipeLookup that never should have been made available outside it.

Outcome

Better performance.

Potential Compatibility Issues

Will cause code breakage. The majority of the time, the fix is changing gtRecipeType.getLookup().find() to gtRecipeType.db().find().

Any addons using the internal implementation details of GTRecipeLookup were doing something very wrong, and there is no obvious migration path for them. They will need to figure out how to move to the actual API methods, or result to brittle unsupported mixins into GT code.

@TechLord22 TechLord22 added type: refactor Suggestion to refactor a section of code Release: API - X.0.0 Major Breaking Refactors that MUST be in a API-Breaking Release type: feature New feature or request bundled for a 0.X.0 Update labels Sep 27, 2025
@github-actions github-actions bot added 1.20.1 Tests: Failed Game Tests have failed on this PR Tests: Passed Game Tests have passed on this PR and removed Tests: Failed Game Tests have failed on this PR labels Sep 27, 2025
@TechLord22 TechLord22 marked this pull request as ready for review September 27, 2025 05:10
@TechLord22 TechLord22 requested a review from a team as a code owner September 27, 2025 05:10
@jurrejelle jurrejelle added Feature Frozen Content Slated for NEXT update during a testing-cycle. Effectively, do not merge with this update. and removed type: feature New feature or request bundled for a 0.X.0 Update labels Oct 8, 2025
@github-actions github-actions bot added Tests: Failed Game Tests have failed on this PR and removed Tests: Passed Game Tests have passed on this PR labels Nov 16, 2025
@github-actions github-actions bot added Tests: Passed Game Tests have passed on this PR and removed Tests: Failed Game Tests have failed on this PR labels Nov 29, 2025
@YoungOnionMC YoungOnionMC changed the base branch from 1.20.1 to 1.20.1-v8.0.0 December 23, 2025 03:16
@jurrejelle jurrejelle removed the Release: API - X.0.0 Major Breaking Refactors that MUST be in a API-Breaking Release label Jan 5, 2026
@jurrejelle jurrejelle added the Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. label Jan 5, 2026
@jurrejelle jurrejelle changed the base branch from 1.20.1-v8.0.0 to 1.20.1 January 5, 2026 13:22
@jurrejelle jurrejelle merged commit 8c0f8c8 into 1.20.1 Jan 8, 2026
4 checks passed
@jurrejelle jurrejelle deleted the tc/recipe-db branch January 8, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 Feature Frozen Content Slated for NEXT update during a testing-cycle. Effectively, do not merge with this update. Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. Tests: Passed Game Tests have passed on this PR type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants