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

Optimize Reflection Usage in ProcessRealchute Method #13

Merged
merged 1 commit into from Dec 25, 2023

Conversation

TuckMeIntoBread
Copy link

Overview

This pull request introduces optimizations to the ProcessRealchute method, significantly improving performance and all but eliminating VAB hiccup/lags related to StageRecovery + RealChute being used in combination.

Changes

  • Reflection Caching: Implemented caching for the Reflection process to reduce execution time. This involves storing references to RealChute's MaterialsLibrary type, the GetMaterial method, and the material library instance.

Impact

The optimizations have significantly reduced the time taken for parachute calculations from an average of ~25ms per execution (which was getting called numerous times inside of loops per onVesselEdit!) to virtually nothing.

@linuxgurugamer
Copy link
Owner

Thank you.
One problem with adopting so many mods is that bad code like this slips through the cracks.
I'll merge and test, will try to get a release out in the next day or so.

LGG

@linuxgurugamer linuxgurugamer merged commit 96cab7d into linuxgurugamer:master Dec 25, 2023
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.

None yet

2 participants