Skip to content

DFS stack-based recipe lookup implementation - #3986

Merged
TarLaboratories merged 15 commits into
1.20.1from
jj/recipe-dfs
Jan 15, 2026
Merged

DFS stack-based recipe lookup implementation#3986
TarLaboratories merged 15 commits into
1.20.1from
jj/recipe-dfs

Conversation

@jurrejelle

Copy link
Copy Markdown
Contributor

What

Swap our recursive recipe search implementation for a stack-based DFS one

Implementation Details

Blocked by #3981

Outcome

[12:26:52] [Server thread/INFO] [GregTechCEu/]: current iterator recipes: 84
[12:26:52] [Server thread/INFO] [GregTechCEu/]: Took 1305.9761 ms
[12:26:53] [Server thread/INFO] [GregTechCEu/]: DFS iterator recipes: 397
[12:26:53] [Server thread/INFO] [GregTechCEu/]: Took 1125.508 ms
image

Additional Information

This fixes a bug with our previous implementation where if a recipe A,B,C is matched, but rejected, it won't look for any other recipes starting with A

Potential Compatibility Issues

Nothing that wasn't broken by the PR it depends on

We still need to do some testing on if we need the predicate at all now? probably not, and it will probably make it faster, since every predicate.test also checks the content for practically no reason now

@jurrejelle
jurrejelle requested a review from a team as a code owner September 28, 2025 12:04
@jurrejelle jurrejelle added type: refactor Suggestion to refactor a section of code 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. labels Sep 28, 2025
@github-actions github-actions Bot added the Tests: Passed Game Tests have passed on this PR label Sep 28, 2025
@jurrejelle
jurrejelle changed the base branch from 1.20.1 to 1.20.1-v8.0.0 December 13, 2025 12:30
@jurrejelle
jurrejelle changed the base branch from 1.20.1-v8.0.0 to 1.20.1 January 5, 2026 13:22
@TarLaboratories
TarLaboratories merged commit dc67cd7 into 1.20.1 Jan 15, 2026
4 checks passed
@TarLaboratories
TarLaboratories deleted the jj/recipe-dfs branch January 15, 2026 08:21
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.

4 participants