ThreadWorkers CPU usage

ThreadWorkers CPU usage

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

ThreadWorkers CPU usage

Post by abma »

ingame in the /debug view, there are these entries:
::ThreadWorkers(accumulated)
::ThreadWorkers(real)
the max-%usage values are
2,37%
3,95%
is this normal? shouldn't the values be higher?

do i understand it correctly, that only at max ~4% cpu usage is shared accross cores?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: ThreadWorkers CPU usage

Post by jK »

`accumulated` is the time when you add the time of each thread -> time a single thread would need to compute the task
`real` is the time that was really spend on the task -> multi threaded performance

So `real` is always < `accumulated` and 'accumulated`/`real` is near cpu core count

And when you want to know how much of the engine runs threaded, it's `accumulated` you want to check.
Also the range of it atm is 4-12%.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: ThreadWorkers CPU usage

Post by abma »

i'm having the problem that spring HEAVILY lags when it tries to use all cores (8). When i set WorkerThreadCount = 2 cores its a lot faster / smooth. but still the max ThreadWorkers(accumulated) is 4.4%. the usual seems 1-2%.
Also the range of it atm is 4-12%.
i never reach this. Its always below 4%.

very likely relevant:
$ grep model /proc/cpuinfo |tail -n 1
model name : AMD FX-8320E Eight-Core Processor
ideas what to test / how to improve this?
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: ThreadWorkers CPU usage

Post by Super Mario »

abma wrote:i'm having the problem that spring HEAVILY lags when it tries to use all cores (8). When i set WorkerThreadCount = 2 cores its a lot faster / smooth. but still the max ThreadWorkers(accumulated) is 4.4%. the usual seems 1-2%.
Also the range of it atm is 4-12%.
i never reach this. Its always below 4%.

very likely relevant:
$ grep model /proc/cpuinfo |tail -n 1
model name : AMD FX-8320E Eight-Core Processor
ideas what to test / how to improve this?
How do you even do that? By editing the source code?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: ThreadWorkers CPU usage

Post by abma »

How do you even do that? By editing the source code?
https://springrts.com/wiki/Springsettin ... hreadCount

also you should avoid full-quotes. its not 100% clear what you mean / what you are referencing. "that" could be everything in the post.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: ThreadWorkers CPU usage

Post by Super Mario »

Oh ok, looks like it needs some profile testing.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: ThreadWorkers CPU usage

Post by jK »

Post Reply

Return to “Engine”