1.09 CPU benchmark

A military-oriented and sci-fi wargame, set on procedural planets with customizable factions and endless choices.

Moderator: Vic

Post Reply
Kaspar
Posts: 59
Joined: Sun Jun 21, 2020 9:42 am

1.09 CPU benchmark

Post by Kaspar »

I just upgraded my CPU, and I thought the results would be interesting to share:

Intel i5 6500K: end of turn time is 175-178 s.
AMD Ryzen 5600X: end of turn time is 85-89 s (from the same save, obviously).

So not surprisingly, a faster CPU makes a dramatic difference.
deoved
Posts: 15
Joined: Thu May 12, 2011 10:00 am

RE: 1.09 CPU benchmark

Post by deoved »

Post your planet setup specifics, please. (How many regimes you have, how much time you gave to AI, etc.)
zgrssd
Posts: 4226
Joined: Tue Jun 09, 2020 1:02 pm

RE: 1.09 CPU benchmark

Post by zgrssd »

As a general rule, for games only single Core Performance maters.
The primary calculation of any game - the primary gameloop - has to be contained to a single Core/Thread by nature.

Having some extra Cores helps to offload unrelated work (OS, some file loading) so the one core can truly work on that single problem with focus. But high core counts do not mater.

Games are like trying to compute the Fibbonacci sequence without being able to use any memory related tricks - Multithreading just can not logically work.
DW2 Poll:
"Should the Civil and non-Combat Ships loose all or most of their weapon slots?"
https://www.matrixgames.com/forums/view ... 1&t=382690
Mercutio
Posts: 255
Joined: Mon Dec 25, 2006 11:49 pm

RE: 1.09 CPU benchmark

Post by Mercutio »

What zgrssd said. Speed of one core, your RAM, your HD (you have SSD, right?)
You had to mention Fibbonacci... bane of my existence with calculating times for getting things done in software. And 8 is about a week, but 1 is a couple of hours. So we can do 20 1s or one 8? 20 does not equal 8, how can I plan on this?
User avatar
BlueTemplar
Posts: 887
Joined: Thu Apr 29, 2010 12:07 pm

RE: 1.09 CPU benchmark

Post by BlueTemplar »

Multithreading just can not logically work
Not even talking about things that don't (directly) impact gameplay (AI, graphics, audio...) that can have a significant impact on performance, this isn't strictly true :

https://www.factorio.com/blog/post/fff-364 (Scroll down to "Multithreaded belts".)

But yeah, multithreading can only be used on specific parts of the game, and is very hard to pull off, especially when you want to keep things deterministic (= always get the same result for the same starting seed), especially in multiplayer across different computers (desynchronization issues) !
phyroks
Posts: 58
Joined: Tue Dec 01, 2020 9:07 am

RE: 1.09 CPU benchmark

Post by phyroks »

well I upgraded from i5 3570k(4,4ghz) to 5600X half a year ago and the same turn got down from 36 minutes to 24 something, was ~35% faster. I5 never capped core and 5600x does not cap core during end turn but just the tech improvements over the year seem to improve it a lot.
User avatar
deMangler
Posts: 322
Joined: Sat Jul 13, 2013 9:37 am

RE: 1.09 CPU benchmark

Post by deMangler »

There can be so many unexpected gotchas with multithreading even in simple applications. I almost never do it.
One exception is the PBEM Helper I recently wrote. I had no choice but to write it so that the filesystem watcher runs in a seperate thread to the gui event watcher. It is the first time I have written such a program and even with something as simple as that I was tearing my hair out debugging some weird cases - I still have no idea if it works on any system other than my development one.
I can easily see why Vic would not want to go there.
Give me deterministic single-threaded any day.
zgrssd
Posts: 4226
Joined: Tue Jun 09, 2020 1:02 pm

RE: 1.09 CPU benchmark

Post by zgrssd »

There can be so many unexpected gotchas with multithreading even in simple applications. I almost never do it.
I like to say: "Multithreading has to pick it's problems carefully."

There are plenty of cases where Multithreading the same code would make it more complex/prone to errors, more memory demanding and in the worst case slower then a sequential approach.
Not even talking about things that don't (directly) impact gameplay (AI, graphics, audio...) that can have a significant impact on performance, this isn't strictly true :

https://www.factorio.com/blog/post/fff-364 (Scroll down to "Multithreaded belts".)
The bulk of processing in factory is what I call "world simnulation".
He was lucky the system was designed (or spend a few months working to make sure it was designed for) acceptable paralellisation.

There are embarrasingly/pleasingly paralell problems. Webservers are such canonical examples, they often do massive paralellisation automatically.
Inherently serial problems. Like the primary gameloop and Fibbonacci sequence without memory tricks.
And a large area in between where paralell slowdown might result in you not pulling relevantly ahead while adding a lot of danger for race conditons - meaning it is just not worth the effort. He was lucky it was worth the effort.
DW2 Poll:
"Should the Civil and non-Combat Ships loose all or most of their weapon slots?"
https://www.matrixgames.com/forums/view ... 1&t=382690
Zanotirn
Posts: 113
Joined: Fri Mar 12, 2021 7:11 am

RE: 1.09 CPU benchmark

Post by Zanotirn »

Multithreading mainly creates issues when processes on different cores work with the same data. However the bulk of game's turn calculations are calculating fronts, and those are largely neatly separated. The game should be able to split the fronts, and process each on separate core. If the outcome of one affects another it would need to dump the preliminary result and recalculate on the main core, but on average you'd still get significant time savings. Plus it can independently calculate things like population changes and construction for each nation (again dumping results if required based on effects of battle resolution).

That being said, adding this kind of multithreading support would require extensive code changes, and I'd say the game has other higher priorities right now)
zgrssd
Posts: 4226
Joined: Tue Jun 09, 2020 1:02 pm

RE: 1.09 CPU benchmark

Post by zgrssd »

ORIGINAL: Zanotirn

Multithreading mainly creates issues when processes on different cores work with the same data. However the bulk of game's turn calculations are calculating fronts, and those are largely neatly separated. The game should be able to split the fronts, and process each on separate core. If the outcome of one affects another it would need to dump the preliminary result and recalculate on the main core, but on average you'd still get significant time savings. Plus it can independently calculate things like population changes and construction for each nation (again dumping results if required based on effects of battle resolution).

That being said, adding this kind of multithreading support would require extensive code changes, and I'd say the game has other higher priorities right now)
As the AI might have to redeploy troops from one front to another, they always interact. They are not pleasingly paralell.
Without knowing how a "AI Front" is even defined, it is impossible to say if they are truly seperated.
And then front processing might not actually be a large part of the AI turn.

Only one AI after the other can act, that is the primary limiter of multitasking.
Given the exponential scaling of AI turn processing as the planetsizes and number of Regimes increases, I doubt the fronts are a huge drain. But we would need actuall statistics to even guess where the issue lies and if it is a relevant issue worth spending effort on.
DW2 Poll:
"Should the Civil and non-Combat Ships loose all or most of their weapon slots?"
https://www.matrixgames.com/forums/view ... 1&t=382690
Post Reply

Return to “Shadow Empire”