Closed siimav closed 2 years ago
Updating the PAW stats eats up a significant amount of CPU cycles - 0.3ms per engine.
One possible fix for this is to update PAW stats only for parts that currently have it open. I implemented something similar in RF here: https://github.com/NathanKell/ModularFuelSystem/pull/277
Much simpler profiling test (1.12.3, RO dev build but no RP-1, TF recompiled w/debug and with a Profiler call added inside the IgnitionFail OnUpdate call.) 4-engines in the sample. Unclear why the GC is much lower in this example. Agree the GC is probably unneeded and the string manipulation for the PAW can be avoided, but very different performance measure.
Potentially fixed with https://github.com/KSP-RO/TestFlight/commit/f3900879c66c6d28a50f3c3ccdf7fd2dfbbf17ae and https://github.com/KSP-RO/TestFlight/commit/ed2423aeab9d324cf9afb7c468ba4bf5f492cb4e
Try it out? Probably also need to register for an event from MEC if we ever actually need to load in a new engine configuration during flight scene