-
Notifications
You must be signed in to change notification settings - Fork 20
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
FlightIntegrator and friends micro-optimization #230
Conversation
…nly relevant in large part count situations. More can be done : I didn't touch yet stuff specific to aero situations (drag, conduction occlusion...) and there is probably something to be done about Integrate()
I think there's some kind of issue related to the camera anchor point. This started happening after I installed this build in tpksp: https://clips.twitch.tv/ModernBusyLemurTinyFace-fvxZ_jtUEAGkjCZc Possibly involving docking or loading a save. |
I may have seen this as well. On the vessel in question, do you also have where you can't get back to the spacecenter via the top menu, but only via esc menu and such? |
To be honest I haven't investigated at all and this has only been reported in TPKSP where we don't use the mouse or normal GUI :p |
Ah, well those are my symptoms when this bug strikes, at any rate. |
…cro-optimizations for various pieces of code running every frame on every part. Won't do much in low part count situations, and some patches are highly situational (atmospheric flight, docking ports, struts, particles repositionning on floating origin shifts...) Patches affecting the FlightIntegrator and VesselPrecalculate are broably incompatible with mods trying to override/extend stuff through MFI. There are a bunch of perf issues with "end of the call stack" methods being inefficient because they do extra work that is already done at the call site or can be made faster by using state from the call site, so patching those methods doesn't cut it, but this mean many stock methods aren't called anymore, so if those methods are replaced/prefixed/postfixed with MFI, things will break. Notable examples are FI.UpdateAerodynamics() and FI.Integrate(Part). This could probably be avoided at the cost of some of the perf gains, but I wanted to see how far things could be pushed perf wise. On a side note, there is a bug lurking in the VesselPrecalculate.CalculatePhysicsStats reimplementation, not sure what it is exactely but a side effect is camera target being wrongly offset. Likely something with the CoM calcs.
-most notably this caused the camera to be anchored to the wrong place
This reverts commit 7346056.
This is ongoing work to micro-optimize the various heavy duty stuff in FlightIntegrator, VesselPrecalculate and possible other flight scene low level components. The focus is on improving performance scaling in large part count situations, mainly by micro-optimizing the per-part work done in these component.
The optimizations are meant to keep behavior as close to stock as possible, but they do introduce minor changes, and given how critical the patched methods are, any bug or behavior change is likely to have dire cascading consequences, so this will need some testing before being pushed.
As of now, there are a few other areas I want to look at before considering pushing this to a (pre)release, but I won't have much time to commit in the next weeks, not sure when I will resume working on this.
Here is a preview release : KSPCommunityFixes_FlightPerf.zip