Skip to content

perf: Optimize ModuleSystemHeatHarvester#168

Merged
Phantomical merged 2 commits into
KSPModStewards:masterfrom
Phantomical:opt-harvester
May 10, 2026
Merged

perf: Optimize ModuleSystemHeatHarvester#168
Phantomical merged 2 commits into
KSPModStewards:masterfrom
Phantomical:opt-harvester

Conversation

@Phantomical
Copy link
Copy Markdown
Contributor

SystemHeat is actually pretty good here, and most of the overhead is in the stock module. The main thing we can optimize is to entirely disable the module when it is not active.

Other than that I have gone through and changed stuff to make better use of the hooks that stock provides:

  • systemEfficency is used to replace GetHeatThrottle. This makes it so that it actually changes the converter rate like it is supposed to. Before the changes written to outputList and inputList were stomped over in PrepareRecipe.
  • We do UpdateFlux in PostProcess and reuse the TimeFactor.

Most of performance optimizations for active drills are over in KSPModdingLibs/KSPCommunityFixes#374.

Together with that PR this fixes most of #167, but I think I still have some further things I want to try in a separate PR.

SystemHeat is actually pretty good here, and most of the overhead is in
the stock module. The main thing we can optimize is to entirely disable
the module when it is not active.

Other than that I have gone through and changed stuff to make better use
of the hooks that stock provides:
* systemEfficency is used to replace GetHeatThrottle. This makes it so
  that it actually changes the converter rate like it is supposed to.
  Before the changes written to outputList and inputList were stomped
  over in PrepareRecipe.
* We do UpdateFlux in PostProcess and reuse the TimeFactor.
@Phantomical Phantomical merged commit 6c4e88c into KSPModStewards:master May 10, 2026
1 check passed
@Phantomical Phantomical deleted the opt-harvester branch May 10, 2026 21:47
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.

1 participant