Jump to content

ADVANCED USERS - Improve KSP performance on Intel CPUs with HyperThreading [TESTED]


1096bimu

Recommended Posts

OK... Shoot this one down.

KSP runs faster when you increase your RAM from 4gb to 12gb.

I know that one is true because I no longer have to wait over 5 minutes to go from the VAB to the launch pad. Used to drive me nuts. That was back in 0.18... Now it's about 7-15 seconds in 19.1 and about 5-10 seconds in 20.2. The game IS getting faster to load and I have less dropouts where the game pauses. I AM having problems with the darn garbage collector crashing the game on me though... You know the one... "Fatal error in gc". Ick!

Link to comment
Share on other sites

Isnt it more likely the program has gotten more efficient at loading since 0.18 than the fact you added memory ? Unity cant handle 12gigs of RAM as it is a 32 bit application in fact the 4 gig you originally had was its limit...so increasing the RAM capacity of your PC doesnt help in KSP.

Link to comment
Share on other sites

Isnt it more likely the program has gotten more efficient at loading since 0.18 than the fact you added memory ? Unity cant handle 12gigs of RAM as it is a 32 bit application in fact the 4 gig you originally had was its limit...so increasing the RAM capacity of your PC doesnt help in KSP.

The 4gb ram limit of 32bit applications is per process. It is possible that there were other background processes which consumed lots of ram so that KSP actually had less than 4gb available and had to swap, but when he upgraded the RAM, KSP was able to utilize the full 4gb it is capable of using.

Link to comment
Share on other sites

The 4gb ram limit of 32bit applications is per process. It is possible that there were other background processes which consumed lots of ram so that KSP actually had less than 4gb available and had to swap, but when he upgraded the RAM, KSP was able to utilize the full 4gb it is capable of using.

64 bit win 7 system requirements are 2gb minimum: The OS doesn't use all of that, of course, or there'd be nothing left to run anything else. But it does use MOST of it. Right now, with no games open (though a fair few background programs), I'm running at 2.01 GB of 8. The majority of those background processes are small and barely using any: Firefox dominates with over 200kb, followed by one of the SVCHost processes at a bit over 130k (hmm, I think I'm going to investigate that). Explorer is running 80k, and everything else is less than 50k each.

My experience with KSP is that it likes to run about 2.4 GB or so. I have a few mods, but not exactly tons and tons, and that number's fairly consistent. So if you're using around 2GB for the OS, and more than 2GB for KSP...the extra from KSP ends up having to be paged out to your hard drive...which is really, really slow. Once it's paged, the performance should pick up, assuming it's not having to mess with it constantly (which it may be.) In theory, anything from about 6GB on up should be able to avoid paging, if you're not running another super memory hog at the same time anyway. 6GB is in theory marginal, being just enough to give KSP the full 4GB it can use ONLY if everything else is using 2GB or less. But if you're pushing 4GB that closely...it's probably going to be crashing with out of memory errors no matter WHAT you do.

As for hyperthreading, the way I recall it working, the first time it showed up anyway, was that it actually is part hardware. They duplicate certain parts of the CPU, mostly cache as I recall(Although not JUST cache), store and manage the two threads seperately, but the heavy lifting is still on the main core. On the original netburst(Pentium 4) architecture, this was in part to mask the fact that they'd designed it to maximize clock speed at the expense of power-per-clock. It could do more operations, sure, but hard ones took a lot longer. That's the whole reason the technology got abandoned in favor of the older, Pentium III based architecture the Israeli branch had used in the Pentium-Ms: it got more power at a given clock speed and put out less heat too (the latter of which was a HUGE problem when the Pentium 4s started exceeding 3ghz.)

I don't think it's divided as evenly as the guy the OP quotes seems to think, either: I'm pretty sure the core use actually gets scheduled on the chip itself, and the 'speed' that it reports is an approximation. If it's like the old ones, part of the reason it's hyperthreaded in the first place is that the pipeline stuff runs through has so many steps and takes so long that you can actually have two different things in two different parts of it at once. If it's also got the property that the old one has where its power on an individual clock cycle is low, it may take more than one cycle to finish a single operation in some cases. Physics crap like KSP I would expect to be one of those cases. If that happens it *can't* flip back and forth every other clock cycle.

So yeah, given what I can remember from like 8 years ago, I'm actually not surprised at all that disabling hyperthreading doesn't help. Common sense wise alone, you're forcing it to do something it's not optimized for.

It *might* help if whatever you're doing is so easy that it can reliably finish the operations in a single clock cycle. For something hard like KSP I wouldn't expect it to, because it was probably already hogging up the core as it was.

Link to comment
Share on other sites

The 4gb ram limit of 32bit applications is per process. It is possible that there were other background processes which consumed lots of ram so that KSP actually had less than 4gb available and had to swap, but when he upgraded the RAM, KSP was able to utilize the full 4gb it is capable of using.

It's also possible that he's playing KSP frequently enough that, with so much memory, Windows is pulling KSP's files into standby. If that's the case it should load substantially faster than before.

Link to comment
Share on other sites

Maybe this is silly, but maybe he confused Hyper Threading with High Precision Event Timer? They're obviously two different things, but I remember disabling HPET and getting less stuttering in a select amount of games (running on an i7 3930k @ 4.2Ghz). Well, either way I'm curious to see if that has any real results. I would do it myself, but something happened in the last few weeks that made my monitor not turn on until the Windows loading screen came up, so my BIOS is invisible.

Link to comment
Share on other sites

The verifiably false part of the claim is this: "Each virtual core is only capable of using a maximum of 50% of the cycles available on the physical core". It's wrong. Hyperthreading does not work like that. The physical core runs 100% of the speed it can, which leaves lots of the parts of this CPU unused because you can't make use of all of them at the same time. Hyperthreading creates a virtual CPU on top of the existing one which feeds a second execution thread to the parts currently unused, at about 20-30% of the speed of the physical CPU. Sometimes more, sometimes a bit less, and it's all "free" performance on top of the 100% of the physical core.

This is why you do not see any difference with HT on and off.

Link to comment
Share on other sites

The verifiably false part of the claim is this: "Each virtual core is only capable of using a maximum of 50% of the cycles available on the physical core". It's wrong. Hyperthreading does not work like that. The physical core runs 100% of the speed it can, which leaves lots of the parts of this CPU unused because you can't make use of all of them at the same time. Hyperthreading creates a virtual CPU on top of the existing one which feeds a second execution thread to the parts currently unused, at about 20-30% of the speed of the physical CPU. Sometimes more, sometimes a bit less, and it's all "free" performance on top of the 100% of the physical core.

This is why you do not see any difference with HT on and off.

^ I was in the middle of writing about the same thing. OP's(Mdbenson) original logic was flawed to begin with. Although a single hyperthreading enabled core presents itself to the OS as 2 separate cores, it is nowhere near as good as 2 physical cores.

Edited by Kilmeister
clarity
Link to comment
Share on other sites

Great stuff! The original post this was directed at was so far off base I didn't bother wasting the time to reply lol.

Now if your up for more science:

Determine your max OC using hyperthreading

Determine your max OC using no hyperthreading (Should marginally more stable and be a bit higher clock than above)

Benchmark both of those in KSP similar to what you did here. I'm thinking the non-hyperthreading for this will win the performance test 8)

As you can see I am only running mine at 4Ghz, I am more obsessed with low power than high performance, I actually have mine undervolted at -0.115v and has dynamic clock rate with a minimal of 1.2Ghz to reduce power.

I'm not sure how far I can overclock it but I don't want to try. In any case, I don't think anyone would really want to play games at clock speeds so extreme that turning off HT makes a difference. I've only heard of that strategy for LN2 overclocking.

Link to comment
Share on other sites

I did a test launch today with a high part vehicle. From liftoff to out-of-fuel it took me one hour and thirteen minutes in real time. :)

I'd be glad to see a performance optimization, but I think it's too early in the build. Let's get the core mechanics in before we bust out the spanners and start loosening bolts.

Edited by Whackjob
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...