Bad performance on multi core cpus - Solution within

Bad performance on multi core cpus - Solution within

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

Post Reply
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Bad performance on multi core cpus - Solution within

Post by Beherith »

I got an i5 750, and immediately loaded up spring to see the performance. (win7 x64 btw)

What I saw with the single threaded build apalled me (I switched back to single thread because I thought turbo boost technology would be perfect for standard spring, as it can accelerate 1 core if the others are unloaded). I set 200 aks to patrol over a larger area, just to give it a little sim load.

Without setting CPU affinity, spring was smeared over all my cores, with an fps of 20:
Image


By setting the affinity to 1 core only via task manager, the performance almost tripled instantly:
Image


Image

I recall there being an external program that set the affinity of spring to 1 core only in the old days. Could this be integrated into the installer?

Can anyone else with multi core CPUs check if they also get their spring switched between cores?
If it does, does setting CPU affinity help your performance?

The tool that can be used to consistently set spring to 1 core(task manager will only keep it for that single instance):
http://www.robpol86.com/index.php/ImageCFG
I attached the program with two .bat files. Unzip it to your spring directory and run the enable bat file.
Attachments
imagecfg.zip
(23.76 KiB) Downloaded 20 times
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Bad performance on multi core cpus - Solution within

Post by jK »

Spring has for a very long time now a "SetCoreAffinity" configtag, possible values are 0:=off, 1:='affinity for 1 core' & 2:='limit to 1 core'.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Bad performance on multi core cpus - Solution within

Post by Beherith »

Why that is great, but spring doesnt set it for itself, and I doubt more than a handful of people knew about that tag. Especially since even finding springsettings.cfg is a difficult task.

But setting it to 1 results in spring eating 1 core 100%, and smearing another cores worth of work over the other three. 45 fps.

Edit: after a while in the test spring decided to go back to smearing itself over all 4 cores, with low performance (20 fps in prev test)

Setting it to 2: this setting is ignored by my os (or spring) and it still goes on all 4 cores.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Bad performance on multi core cpus - Solution within

Post by aegis »

Performance is about the same for me with affinity set or not (win7 64-bit with an i7 here)

Are you running XP? Have you applied the multicore fixes?

http://forum.notebookreview.com/sager-c ... o-you.html

I believe this particular problem has been fixed since Vista - I've never had to force a program to a single core since I switched from XP to 7.

Microsoft has two KnowledgeBase articles on the issue, one of them says "These performance issues may sometimes occur if the game was not designed for use on computers that use dual-core processors. The performance issues occur because the game cannot correctly capture timing information."
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Bad performance on multi core cpus - Solution within

Post by Beherith »

Beherith wrote: (win7 x64 btw)
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Bad performance on multi core cpus - Solution within

Post by aegis »

ah, missed it because your task manager didn't have the UAC icon on resource monitor and you're on the classic theme.

haven't ever had spring performance issues on my i7 laptop

can you run cpuz to see if your first core scales above the base clock?
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Bad performance on multi core cpus - Solution within

Post by zerver »

Beherith wrote:Especially since even finding springsettings.cfg is a difficult task.
No need to fiddle with it, you can start Spring and click Edit Settings.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Bad performance on multi core cpus - Solution within

Post by hoijui »

.. location is also visible in infolog.txt.. but i agree that SettingsEditor should have a plain-view of all settings too.
Machete234
Posts: 642
Joined: 12 Feb 2010, 11:55

Re: Bad performance on multi core cpus - Solution within

Post by Machete234 »

Strange I have somewhere between 200fps and never less than 60 no matter what happens. (demos of huge games at 5x speed)
With my phenom 965 but I also use the MT exe file.
But i dont think it would be a lot worse without the MT.exe

also win7 and 64bit
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Bad performance on multi core cpus - Solution within

Post by Argh »

XP SP3+ doesn't need to install the multicore fixes, they're already installed. Performance over here with games that can use more than one processor has been excellent.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Bad performance on multi core cpus - Solution within

Post by FLOZi »

Yeah, I stopped having to use imagecfg when I upgraded to XP SP3. I haven't tried it out since though, so I can't comment whether the performance is as-good or just good-enough-I-didn't-bother.
Manoa
Posts: 79
Joined: 19 May 2008, 18:51

Re: Bad performance on multi core cpus - Solution within

Post by Manoa »

rename spring.exe to spring1.exe
download prioaff.exe from somewhere
create a new file: spring.cmd
add code:

Code: Select all

path\to\prioaff.exe 3 10 path\to\spring1.exe %1 %2 %3
change spring executable in springlobby to where spring.cmd is and enable use old launch method

this method requires manually configuring the core on which wished to be run, it is the binary form in the command, 10 means CPU #1, 01 = CPU#0, 11 = CPU #0, #1, binary is right to left, the number 3 represents the priority of the process, in my patched version I added belownormal and abovenormal, so you have:
0 - idle
1 - belownormal
2 - normal
3 - abovenormal
4 - high
5 - realtime

in the standard edition there is only 3, so be careful to change the priority value if not using my version. I recommend to use this on other programs and system processes, for after-launch affinity control I recommend process.exe.
Attachments
Process.7z
commandline Process controller
(21.92 KiB) Downloaded 18 times
prioaff.7z
commandline Priority and affinity launcher
(5.43 KiB) Downloaded 24 times
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Bad performance on multi core cpus - Solution within

Post by Licho »

This is well known old bug i reported years ago..

Sometimes it helps to change threading support in nvidia drivers.

Also i made "springloader" years ago, which starts spring with affinity and priority set (and optionally switches to fullscreen when not speccing and windowed when speccing).

You can find it in forums i think.
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

Re: Bad performance on multi core cpus - Solution within

Post by Masure »

Licho wrote:This is well known old bug i reported years ago..

Sometimes it helps to change threading support in nvidia drivers.

Also i made "springloader" years ago, which starts spring with affinity and priority set (and optionally switches to fullscreen when not speccing and windowed when speccing).

You can find it in forums i think.
+1 to setting threaded optimization off in NVidia panel for spring.exe profile.
Attachments
2010-06-13_140228.png
(8.01 KiB) Downloaded 3 times
Post Reply

Return to “General Discussion”