Skip to content

Reduce harmony patch overhead#34

Draft
Owlchemist wants to merge 1 commit intoVanilla-Expanded:mainfrom
Owlchemist:main
Draft

Reduce harmony patch overhead#34
Owlchemist wants to merge 1 commit intoVanilla-Expanded:mainfrom
Owlchemist:main

Conversation

@Owlchemist
Copy link

Lots of VFE mechanoid patches are running even if you don't use that mod. Regardless of how lightweight the patches themselves may be, they would still add detour overhead to the methods of which are running constantly.

  • These changes gate the patches to only apply on game startup if relevant.
  • Added a check to see if the mod is active and applied it to other checks throughout the code that do the same, to unify it.
  • Also a small optimization to ModCompatibilityCheck's startup impact

It may be good to have Taranchuk sign off on this one as, afaik, those harmony patches belong to him. I skimmed them over but as far as I could see they would be fine to omit when VFEM isn't active.

VFE Mech patches only apply if relevant. Added a check to see if the mod is active and applied it to other checks throughout the code that do the same, to unify it. Also a small optimization to ModCompatibilityCheck's startup impact
@erdelf erdelf requested a review from Taranchuk March 27, 2023 01:54
@Taranchuk
Copy link
Contributor

The thing is that not only VFEM mod uses these mechanoid patches, but also RimEffect, Reinforced Mechanoids and Mechanoid Foundry. The code was put into the framework for a reason otherwise would stay in VFEM where it was created initially.

@erdelf
Copy link
Contributor

erdelf commented Mar 27, 2023

We might be exploring other ways to lessen the load in the future, but this for now doesn't work, as taran explained.

@erdelf erdelf closed this Mar 27, 2023
@Owlchemist
Copy link
Author

Would just checking to see if a CompMachine exists anywhere in the database work as a new gate?

@Taranchuk
Copy link
Contributor

Could work this way.

@legodude17
Copy link
Contributor

legodude17 commented Mar 27, 2023

Maybe instead of doing the flat mod presence check you could have CompMachine and Machine set flags on load to apply the patches?

Edit: Yeah basically what you already said.

@Owlchemist
Copy link
Author

Sure. I can just redirect the bool to point to that logic instead, then.

@erdelf erdelf reopened this Mar 27, 2023
@legodude17
Copy link
Contributor

Maybe move it out of ModCompatibilityCheck, then. Since it's not really a mod compat thing anymore.

@legodude17 legodude17 marked this pull request as draft May 24, 2023 15:22
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.

4 participants