Principia icon indicating copy to clipboard operation
Principia copied to clipboard

Poor performance at max timewarp in Realism Overhaul

Open rsparkyc opened this issue 5 years ago • 9 comments

I've noticed that I have poor KSP performance when running Principia under a Realism Overhaul environment. Stock seems fine, but stock limits timewarp to 1x105, however Realism Overhaul boots that up to 6x106 (60x higher than stock). I'm assuming that's where my issues are coming from, but @eggrobin suggested I go ahead and add a ticket here.

I'm running a MacBook Pro with the following specs

  Model Name:	MacBook Pro
  Model Identifier:	MacBookPro14,3
  Processor Name:	Intel Core i7
  Processor Speed:	3.1 GHz
  Number of Processors:	1
  Total Number of Cores:	4
  L2 Cache (per Core):	256 KB
  L3 Cache:	8 MB
  Hyper-Threading Technology:	Enabled
  Memory:	16 GB
  Boot ROM Version:	194.0.0.0.0
  SMC Version (system):	2.45f0

rsparkyc avatar Jul 13 '19 22:07 rsparkyc

It's worth noting that decreasing the steps in principia's prediction settings cuts my performance hit in about half.

rsparkyc avatar Jul 15 '19 14:07 rsparkyc

I was going to ask about the prediction lengths. Can you tell us how many fps you get for various settings of the number of steps? Also how many vessels do you have? I have noticed that long predictions burn a lot of CPU on the UI thread.

pleroy avatar Jul 15 '19 21:07 pleroy

Only one vessel, and I turned the prediction length down to its minimum value

rsparkyc avatar Jul 16 '19 16:07 rsparkyc

I really want to know the version of Principia you're using, because there is a bug of super low performance on MacOS due to some CPU management issues a long time ago, I believe it's fixed at the May update, but considering there's only 3 more updates after the May update, a lot of players could still have not updated their Principia.

xiaoqianWX avatar Jul 29 '19 13:07 xiaoqianWX

I remember that bug, but I'm pretty sure I'm on an up to date version: I0729 11:16:36.451540 71497152 interface.cpp:629] Principia version 2019070219-Fermat-0-g6f9dc87d7b1cbf8b7e3733f96bb5f2e1ca104360 built on 2019-06-29T13:30:55Z by Clang version 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.2) for OS X x86-64

rsparkyc avatar Jul 29 '19 15:07 rsparkyc

Have you removed the asteroids? If not, you should do so, they count as vessels and are quite expensive to integrate, especially considering that you only have 4 cores.

pleroy avatar Jul 29 '19 17:07 pleroy

I have not, thank you for pointing that out, I will try it.

rsparkyc avatar Jul 29 '19 18:07 rsparkyc

That does seem to improve performance a bit. Not nearly as smooth as when I have no vessels in orbit, but not as bad as before. I'm curious, if principia is calculating orbits for everything else in the solar system, what is it doing differently when there is one extra "thing" out there (that "thing" being an actual vessel). The only thing I could think of would be path history and projection, but I've turned those way down, and I'm timewarping from the space center and not the tracking station

rsparkyc avatar Jul 29 '19 19:07 rsparkyc

(Sorry, I missed the last question.)

The difference between "no vessel" and "one vessel" is that vessels are integrated much more frequently than celestials. For celestials we use a step of 35 minutes by default. For vessels, we use 10 seconds. It makes sense when you think of it: celestials are on smooth trajectories and not much happen to them over 35 minutes. On the other hand, when you are doing a rendezvous in low orbit, you really want to know the position of the vessels all the time. (That's in warp; when not warping we do one step for every frame.)

We do vessels in parallel so with 4 cores there won't be much difference between 1 vessel and 4 vessels.

pleroy avatar Aug 12 '19 20:08 pleroy