Skip to content

Optimize gate renderer and model initialization - #88

Merged
boubou19 merged 15 commits into
masterfrom
speedup_boot
Aug 15, 2026
Merged

Optimize gate renderer and model initialization#88
boubou19 merged 15 commits into
masterfrom
speedup_boot

Conversation

@boubou19

Copy link
Copy Markdown
Member

Summary

The projectRedFabreication.init() was taking 2.5s of boot time in my instance (~3%). With this PR, we are down to only 31ms now 😂

To achieve this, with the help of AI, i did the following:

  • added regression tests to verify the rendered models stayed the same between each commit
  • Lazily construct gate renderers and component models
  • Precompute built-in wire layouts while preserving resource-pack overrides
  • Remove redundant wire geometry copies and cache equivalent layouts
  • Cache repeated torch geometry while keeping mutable state isolated

Tested on daily 677, and nothing seems to have changed:
2026-08-14_12 14 41

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@boubou19 boubou19 added ✔️ Tested in full GTNH instance This Pull Request has been tested in a full GTNH install. AI This PR was made with heavy AI assistance and needs more thorough review. Performance Changes with the goal of improving performance. Refactor For PRs rewriting a part of the code to have a nicer code overall. labels Aug 14, 2026
@Caedis
Caedis requested a review from a team August 14, 2026 10:28

@UltraProdigy UltraProdigy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a Scala expert by any means but looks clean from what I can tell in code and there are no signs of regression in game. I didn't look very hard at the test files as I'm pretty sure those are moreso AI smoketests but I had Sol look them over and it's on board.

Whether we want to merge or have someone with a deeper skillset in looking at Scala I will leave to the powers that be. But this seems like a safe & worthy inclusion in 2.9 and I don't want it to get held up because no one wants to review Scala.

@boubou19
boubou19 merged commit e173952 into master Aug 15, 2026
1 check passed
@boubou19
boubou19 deleted the speedup_boot branch August 15, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI This PR was made with heavy AI assistance and needs more thorough review. ✔️ Tested in full GTNH instance This Pull Request has been tested in a full GTNH install. Performance Changes with the goal of improving performance. Refactor For PRs rewriting a part of the code to have a nicer code overall.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants