Spring CPU Usage... Multithreaded?

Spring CPU Usage... Multithreaded?

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

Moderator: Moderators

AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Spring CPU Usage... Multithreaded?

Post by AreaFire »

Ok, I'm a nub to Spring Development. I remember seeing some multithreading work done, but I don't know if it went anywhere. So this is why I'm here: I have a dual-core system, with both cores running at 100%. When I look at windows task manager, it shows that spring is using all my CPU (98%).

Was a breakthrough finally made? What changed that allowed spring to use both cores in this fashion? Or am I just retarded? =)
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Re: Spring CPU Usage... Multithreaded?

Post by Caydr »

No, that's the blu-ray you're ripping in the background.
AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Re: Spring CPU Usage... Multithreaded?

Post by AreaFire »

No, specifically under "Processes" in the "Windows Task Manager", you can see a list of all active processes in Windows. In my specific case, Windows 7.

Now, looking at this list, I can see what percentage of CPU time is going to each process. Spring.exe is using 98% of my CPU. Next time I play, I can take a screenshot if you would like. I don't ever have anything running in the background, not even a virus scan.

If I click the "Performance" tab, the one with the green bar graphs, both cores are pegged at 100%.

So I ask, once again, how is Spring using that much of my CPU?
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Re: Spring CPU Usage... Multithreaded?

Post by Caydr »

Sorry, I was projecting my current activities onto you.

Hmmm... that is strange. I haven't actually started up Spring in the last month (trolling, Alpha Centauri, Jedi Knight) but last I heard only one person was working on MT since there was too much potential benefit and not enough risk of malicious exploitation.

A screenshot of your process and performance lists might be useful, yeah... make the process list in order of memory usage, then another in order of CPU usage, it might give some clues. What type of CPU do you have? I'm really more concerned by the fact that you managed to consistently max out even one core, let alone two. Sounds like some kind of bug.
AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Re: Spring CPU Usage... Multithreaded?

Post by AreaFire »

Caydr wrote: I'm really more concerned by the fact that you managed to consistently max out even one core, let alone two. Sounds like some kind of bug.
I've almost always managed to max out one core, since I started playing (maybe Feb '09?). My CPU is an older Core Duo running at 2.16 Ghz in a 3 year old Dell Latitude D820. My video card is a 512 MB Nividia Quadro NVS120M, same architecture as a GeForce Go7400, overclocked 580/950 (please no laughing).
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Spring CPU Usage... Multithreaded?

Post by Beherith »

Your system may split the originally single threaded spring onto two cores, but this doesnt result in a performance boost, since context switching is expensive between cores. Single threaded spring will always max out a core, because it uses non-simulation excess cpu time to render more frames (simulation runs at a constant 30+2 frames per second).
You should therefore, restrict spring to one core, by setting cpu affinity to a single core. Also, disable nvidias threaded optimization in your nvidia control center.
True multi threaded spring is availabe, and provides a performance boost; see the thread titled "spring running in SMP"
I'm really more concerned by the fact that you managed to consistently max out even one core, let alone two. Sounds like some kind of bug.
Please launch spring. Kthxbai.
AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Re: Spring CPU Usage... Multithreaded?

Post by AreaFire »

Tried a single player game where I did everything I could to max out the CPU. Had 400 Jeffy running around a DSD map while spamming 5 Vulcans at them. No luck.

Went to a multiplayer game. Ended up being 6v6 BA game on Tabula V2. Was able to get to 100%.

Widgets used: everything that BA runs stock, plus Stockpiler and Immobile builder.

Funny thing is, my FPS doesn't suffer. At game start, I'm able to run 60+ (caps at 60). At this point late in the game (maybe 3-400 units on screen) I was running around 25ish. CPU still running at 100% though, on both cores. Maybe something widget related?

P.S. to above: It's not like my cores are switching. Typically, when I see a single CPU intensive process that is switching cores, I see overall CPU usage at 50%, and each core at about 50%. Screenshots verifiy.
Attachments
CPU3.png
CPU3.png (33.07 KiB) Viewed 2767 times
cpu2.png
cpu2.png (52.07 KiB) Viewed 2765 times
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Spring CPU Usage... Multithreaded?

Post by Beherith »

Please reread my post. Getting 100% on a dual core machine with vanilla spring is neither desirable nor optimal. If you want it to properly use both of your cores, get the MT build linked in my prev post. Also, disable threaded optimization in nvidia control panel.
AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Re: Spring CPU Usage... Multithreaded?

Post by AreaFire »

Beherith wrote: If you want it to properly use both of your cores, get the MT build linked in my prev post. Also, disable threaded optimization in nvidia control panel.
Disabled about 5 minutes after I installed Nvidia performance drivers.

I read your post. I'm familiar with core switching (unless I'm mistaken, a single process swtiching between cores shouldn't load the CPU more than 50% + a little extra). I'm not trying to make this happen. I'm in no way forcing this. It never happened in previous versions of spring (mostly played on Windows 7 beta) so the resulting changes are in:
1)Windows 7 release vs Windows 7 beta
2)Older spring version vs current
3)Unknown.

Merely... odd to me. FPS is the same, game performance the same, just wondering what the difference is.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Spring CPU Usage... Multithreaded?

Post by Beherith »

Whoops, my bad, didnt notice you ran win7. I have no experience pertaining to that.
AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Re: Spring CPU Usage... Multithreaded?

Post by AreaFire »

All good :-) . It doesn't affect game performance, so I don't really care. It's more about the scientist inside of me wanting to know what changed.

One more possibility:
Maybe spring is only using that much CPU when I Ctrl+Alt+Delete to check the performance? When I'm full screen, Spring is acting normal. Then I bring up task manager, and the load increases? I can hear it running in the background so it must be doing something when I tab out. I'll follow up on that...
AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Re: Spring CPU Usage... Multithreaded?

Post by AreaFire »

Nope... CPU pegged at 100% whether tabbed in or out. Whatever.
User avatar
Otherside
Posts: 2296
Joined: 21 Feb 2006, 14:09

Re: Spring CPU Usage... Multithreaded?

Post by Otherside »

i got a quadcore machine and spring will use one full core (reading 25 percent on task manager) when running even when it isnt doing much though it doesnt apply much load as i still wont go over 20 in the ingame reading even in huge games.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Spring CPU Usage... Multithreaded?

Post by zerver »

Beherith wrote:Your system may split the originally single threaded spring onto two cores, but this doesnt result in a performance boost, since context switching is expensive between cores.
Well, context switching is indeed expensive unless you have hyperthreading. However, the reason it cannot go above 50% is that a single thread can not run concurrently under any circumstances.

My guess:
1. Your cpu is not a real dual core, but a single core with hyperthreading.
OR
2. Your cpu is overheated and doing thermal throttling.
OR
3. Windows 7 is automagically superthreaded
AreaFire
Posts: 41
Joined: 27 Aug 2009, 18:08

Re: Spring CPU Usage... Multithreaded?

Post by AreaFire »

1)It's an Intel Core Duo T2600 @ 2.16 Ghz, Code name Yonah, definitely true dual core.

2)When it throttles, it pulls the speed back to 1 Ghz (confirmed from previous experimentations with CPU Burn-In while blocking the fan ducts. My fan is on while playing spring, but not wide open like it is when I'm overheating. CPU-Z verifies that my clock speed stays at the full 2.16 Ghz, and doesn't throttle back.

3)Windows 7 claims to have done more multithreading optimization, but that sounds vague.
User avatar
Spawn_Retard
Posts: 1248
Joined: 21 Dec 2006, 14:36

Re: Spring CPU Usage... Multithreaded?

Post by Spawn_Retard »

Beherith wrote: Also, disable nvidias threaded optimization in your nvidia control center.
What if my setting is on auto? What does spring choose?

Edit: i ask this because i dont want to be switching this setting each time i play a different game
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Spring CPU Usage... Multithreaded?

Post by CarRepairer »

Spawn_Retard wrote:
Beherith wrote: Also, disable nvidias threaded optimization in your nvidia control center.
What if my setting is on auto? What does spring choose?

Edit: i ask this because i dont want to be switching this setting each time i play a different game
There's a list of profiles for all your games in that setting page. Go find spring in the list (or add it?) and disable it for just spring.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Spring CPU Usage... Multithreaded?

Post by Jazcash »

There are already multi-threads on this.
User avatar
Spawn_Retard
Posts: 1248
Joined: 21 Dec 2006, 14:36

Re: Spring CPU Usage... Multithreaded?

Post by Spawn_Retard »

CarRepairer wrote:
Spawn_Retard wrote:
Beherith wrote: Also, disable nvidias threaded optimization in your nvidia control center.
What if my setting is on auto? What does spring choose?

Edit: i ask this because i dont want to be switching this setting each time i play a different game
There's a list of profiles for all your games in that setting page. Go find spring in the list (or add it?) and disable it for just spring.
I cant see shit captain, it only says to make it auto.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Spring CPU Usage... Multithreaded?

Post by CarRepairer »

You're in a tab called global settings. Click on program settings. If you don't see that then I don't know.
Post Reply

Return to “General Discussion”