Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significantly Improve Performance of Early Generators #6017

Merged

Conversation

voidsong-dragonfly
Copy link
Contributor

Improves thermoelectric generator performance by a minor amount, but the main meat is the waterwheel rewrite.

Waterwheels have an ~order of magnitude performance increase expected for flowing wheels, or ~50x for completely stationary wheels. This comes mainly from not checking the torque every tick, but instead on update.
Old code: spark profile
New code, running estimate: spark profile
New code, perfectly stationary: spark profile

 - Removed updates of speed on every tick
      - Speed updates are once every 1024t
      - Speed also updates on block update
      - Update on block update happens on a deferred tick to make sure calculation is not happening many times with many updates
 - Changed data sync to client to be on update, not on every tick
 - Added javadocs to a few more methods
 - Capability checks now exit when power to be transferred is zero, rather than checking all sides for capabilities
 - Lack of calculating rotation on client meant the wheels stuttered when they got synced
 - Left in print statement was printing on every update
 - Deferred updates were handling incorrectly, correct comparison is now in place using Long.MAX
@voidsong-dragonfly voidsong-dragonfly marked this pull request as ready for review July 14, 2024 16:20
@BluSunrize BluSunrize merged commit 8cf0cad into BluSunrize:1.20.4 Jul 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants