Page MenuHomeSchine - Phabricator

Starmade | High CPU usage in Advanced build.
Closed, InvalidPublic

Description

#1 Chaosinflesh original report
I have noticed in advanced build mode that my CPU usage goes up considerably. I have just tested this, and attached screen shots of what is happening. Each screen shot has a brief description of what I was doing.. which was pretty much nothing except holding in advanced build mode.

Test conditions:
800,000 block ship, mirrored on XY, YZ, and XZ planes.
1x1x3 block size selected.

#2 Lancake:
I have noticed in advanced build mode that my CPU usage goes up considerably. I have just tested this, and attached screen shots of what is happening. Each screen shot has a brief description of what I was doing.. which was pretty much nothing except holding in advanced build mode.

Test conditions:
800,000 block ship, mirrored on XY, YZ, and XZ planes.
1x1x3 block size selected.

I don't know the underlying cause, but I have noticed that the block outline tool is calculating the outline far more often than required.

It seems trite, but using lots of CPU purely because I'm holding the CTRL key seems a little off to me.

Great game, btw ^^

I don't know the underlying cause, but I have noticed that the block outline tool is calculating the outline far more often than required.

It seems trite, but using lots of CPU purely because I'm holding the CTRL key seems a little off to me.

Great game, btw ^^

#3 Chaosinflesh:
Okay cool, I'll run some more exhaustive tests with the dev build today. I have a dedicated server now, so that will remove the VM from the equation also.

I'm wondering if it's exacerbated by the hyper-threading of my CPU - past experience has shown Java and HT don't play nice once you're into logical cores. I'll try disabling that, see if it makes a difference.

Should probably have called the topic high[er] than expected CPU :P

So, when not using a VM:

H/T enabled: sitting in build mode, 2.5% CPU
H/T enabled: holding in advanced build, 10% CPU
H/T disabled: sitting in build mode, 5% CPU
H/T disabled: holding in advanced build, 20% CPU

Consistent with the move from 8 to 4 logical cores, considering this is not a stress test.

No difference testing this time with symmetry disabled/enabled; test was sitting in StarMade build mode for a minute, before holding in advanced build for 30s. No mouse movement for either. This test was with a much smaller ship than previously: it could be that the higher CPU usage seen in my first test was caused by excessive page faults from having two large Java VM's active, which could be considered unrelated to StarMade.

#4 Lancake:
Thanks, seems that it is indeed higher than expected. If this is within expected values than the devs can just reject the issue.

Details

Task Type
Bug
Testing Results
Affected Gamemode(s)
Single and Multi
Reproducible
Yes
Last tested (version)
0.19307 (Dev)
Category
Engine
First occurrence (version)
0.1917
Hardware/Software/System
OS-Specific
No
Hardware-Specific
No
Video Card Vendor
uncertain
Serverconfig (server.cfg)
<replace this line with the file content>
Clientconfig (settings.cfg)
<replace this line with the file content>

Event Timeline

SmilingDemon updated the task description. (Show Details)Jul 4 2015, 12:04 PM
SmilingDemon changed Category from none/unspecified to Engine.
SmilingDemon changed Affected Gamemode(s) from none/unspecified to Single and Multi.
SmilingDemon set First occurrence (version) to 0.1917.
SmilingDemon changed Reproducible from uncertain to Yes.
SmilingDemon set Last tested (version) to 0.19307 (Dev).
SmilingDemon edited Serverconfig (server.cfg). (Show Details)
SmilingDemon edited Clientconfig (settings.cfg). (Show Details)
SmilingDemon added a subscriber: SmilingDemon.
SmilingDemon created this task.
SmilingDemon raised the priority of this task from to High.
SmilingDemon changed the task status from Open to In Queue (Game).Jul 4 2015, 12:10 PM

Just pushing the Button for advanced Build mode and waiting a moment pushes my CPU load in the taskmanager up by 20% on an i5-4590K.

thats a lot for doing basically nothing!

Restricted Application edited projects, added Game Development; removed Issue Navigation. · View Herald TranscriptJul 4 2015, 12:10 PM
SmilingDemon set Task Type to Bug.Jul 4 2015, 12:10 PM
SmilingDemon edited a custom field.
SmilingDemon set OS-Specific to No.
SmilingDemon set Hardware-Specific to No.
SmilingDemon set Video Card Vendor to uncertain.
SmilingDemon moved this task from Unclassed to Issue affecting current release on the Starmade board.
SmilingDemon renamed this task from High CPU usage in Advanced build. to High CPU usage in Advanced build. .
SmilingDemon changed the visibility from "Custom Policy" to "Public (No Login Required)".Jul 4 2015, 2:53 PM
SmilingDemon changed the edit policy from "Task Author" to "Starmade (Project)".
schema added a subscriber: schema.Jul 22 2015, 12:47 AM
schema changed the task status from In Queue (Game) to Open.

cannot reproduce. cpu

10 sec pressed, 10 sec off, 10 sec pressed

(check if it happens in a sector with a lot of ships)

Restricted Application edited projects, added Issue Navigation; removed Game Development. · View Herald TranscriptJul 22 2015, 12:47 AM
Restricted Application added a subscriber: AndyP. · View Herald Transcript

in my sector floating in a 3 block ship in build mode (same as if not in a ship core)

same thing with holding CTRL

the sector in question ... not that crowded

maybe only my system ? someone else who can verify this ?

Hm, tried this in fullscreen and windowed, could not see any difference from build-mode to flight mode.

Possibly hardware specific?
(I noticed a huge difference by related view angle, a slight change can alter the cpu usage a lot.)

Rokiyo added a subscriber: Rokiyo.EditedJul 23 2015, 3:33 PM

Just tested this now on v19320, can confirm that holding CTRL has an impact on my machine:

CPU usage in the task manager also increases from approx 18% to 21% (a 3% increase), and I can hear my system fans whirring slightly faster while I hold down CTRL.

SmilingDemon added a comment.EditedJul 23 2015, 5:04 PM

Tried again
Only game and Taskmanager running .. same effect ..jumps from around 55 to 75 CPU usage on pressing The CTRL Button

Hardware:
I5 4670K CPU
8GB Ram (2 assigned to SM SP)
R9 280X GPU - AMD

Settings.cfg

full Ingame Info
Pressed


not Pressed

with uncapped FPS Pressing CTRL drops that from 230 to 125 in the scene above

Ok, for the sake of comparison:

Hardware:
I7 2600K CPU
8GB RAM (2GB assigned to client)
NVIDIA GeForce GTX 570

Software:
Windows 7 64bit
Java build 1.7.0_75-b13

Settings.cfg

My uncapped FPS is dropping from 85 to 78 while in a build block on my ~350 block wide planet (which is where I took the above screenshots).

Oninoni claimed this task.Jul 25 2015, 3:52 PM

Not happening for me. CPU load heavily depends on Segment Count, but not on the Flight/BuildMode

Oninoni removed Oninoni as the assignee of this task.

Could you please post some information about your system so we can compare?

Also can you please confirm that world_draw etc don't change when you are in advanced build mode?

xarses added a subscriber: xarses.Jul 28 2015, 2:24 AM

Does not reproduce with Linux / nvidia-non-free.

My system jumps around 1-5% for around 1-10 sec, honestly I have more cpu load sitting outside of a ship than attempting this

Please post your ship and OS info. I suspect its either specific ship build or to your Video card / driver

Mine and Rokiyos Sys specs are in there:
its not AMD/Nvidia related (because both of us have this issus showing)
i5-4 Gen and i7-2nd Gen CPU shouldnt have any problems handling this with 15-20 % load jumps
Java 7 and 8 (mine) are similar affected
both runnning win 7 64
.. out of ideas i am

Gamel added a subscriber: Gamel.Jul 28 2015, 3:59 PM

can't reproduce the problem

OSX, i7-3720QM, 650M

Could you guys who are not seeing the CPU increase please also confirm that WORLD_DRAW/RENDERLOOP etc are not changing when you enter advanced build mode?

You'll need to change the 'Tech Info' option to 'ALL_INFO' to see that information.

@Rokiyo

Sorry, I'm not familiar with the option or button sequence to show that information. can you provide some more robust directions on how to enable that?

NuclearFun added a subscriber: NuclearFun.EditedJul 28 2015, 9:15 PM

Well, i tried to reproduce the problem. Couldn't get reliable data from the CPU (poor signal to noise ratio :( and i would need a better logger if i would go for some statistics...)
But: FPS alone gets hit heavier than i expected:
http://i60.tinypic.com/ndo3ft.jpg
(130 sek, 10 sek normal, 10 sek advanced, inside a 50k mass ship)

AMD PhenomII @3.2GHz
AMD Radeon 270X

Okay, to summarize this:

Enabling the advanced build mode,
adds an overlay over the existing menu and draws additional things,
the load on the GPU increases.

The DRAW, SCENEDRAW and RENDERLOOP values change.
Also the FPS drop.

Is the impact really over a sane limit?
(Even with my poor video card on the old pc there is no much difference, some small raise in load, but mostly to GPU, cpu is a side effect of the GPU/CPU balance.)

As I do not really see a way to simplify the build mode menu without loosing functionality.
Possibly compare:
"Preview block to build" option, as this draws an 3D block in the overlay, and may be a cause of additional load, that is not related to the build mode menu, if it also happens to some extend when using the "rotate block" overlay as pilot, we may blame this, for the performance usage, but it has its own option to turn it off, so nothing to work on again.

I do not really see a base to send this to development for something to work on.
We all tried it, and the amount of impact is high enough to measure it, but not high enough to see it as an issue.

If anyone has objections or additional measurements to make, that would back some bug alike behavior, please add it.

SmilingDemon added a comment.EditedJul 29 2015, 5:57 PM

My relevant system
Hardware:
I5 4670K CPU
8GB Ram (2 assigned to SM SP)
R9 280X GPU - AMD

CPU load increases 20% and drops significant in FPS (at least according to the onscreen ingame info)

example 5 % to 25-30% load and FPS 700+ down to 400 when in an empty sector only in a cores build mode

i wouldnt call my system high end ... but it is defninitly above midrange or average in performance.

so i would call this a problem if we do not know what causes it

Draw/WorldDraw/RENDERLOOP go up by 10 if CTRL is pressed when vsync is active ... for me at least

So, I ran some tests on my end. (There aren't any open issues up for grabs right now) I made a brand new world, with a brand new install.

My system:

  • AMD FX-8320 3.5GHz 8 cores
  • 16GB DDR3 1600
  • GeForce GTX 560
  • Windows 7 64bits
  • Java VM 64bits (1.8+ I was absent minded enough to update to latest while I was writing this, so I can't give the exact version number..)

Here are my current settings:

I made a large(absolutely horrible) ~2,000,000 blocks ship, larger than described in the ticket. I set all 3 symmetry planes. (I had to increase the build area in the settings to 250 to speed things up, I also toggled on the "all info" display on the hud, and locked FPS to 60.)
Without advanced buildmode, and with only unlinked system blocks(Thrusters, power reactors, power capacitors, a lone canon computer, and std armor blocks), my total CPU usage is a steady 14-16%.
I get a steady ~5% CPU usage increase with advance buildmode on.

However, I get a ~12+% increase (cpu usage is now steady at ~26%) if I add Canon blocks while a canon computer block is selected, even WITHOUT advanced build mode on. When opening advanced buildmode, the CPU usage stays close to ~26%.

If I replace the canon blocks with standard armor, CPU usage without advanced build mode is 15%.


If I toggle advance build mode on, it sticks at only ~20%.

After restarting the game, and getting back into build mode for the same ship, with all the canon blocks still there, I get 15% CPU usage, in regular build mode, and 20% in advance.
The second I select the canon computer however, CPU usage is stuck at ~26-28% usage whether in advance build mode or in regular.

There seems to be an increase in CPU usage more or less proportional to ship size when toggling on advance buildmode. On a tiny ship made of 117 blocks, its around 1% for me:



..while on that big 2,000,000 blocks ship its around 5%.

Maybe there is something else in particular affecting performances on some people's world/ship perhaps ?
Something about selected linked system blocks is clearly affecting CPU usage though, I can at least say that for sure..

The size of whatever is around me has no impact in my case

qoute myself "example 5 % to 25-30% load and FPS 700+ down to 400 when in an empty sector only in a cores build mode"

thakyZ added a subscriber: thakyZ.Aug 4 2015, 3:18 AM

I can reproduce on Windows 10 with AMD Radeon HD 7800 and Java 8

thakyZ added a comment.Aug 4 2015, 3:45 AM

Could this be the cause for the cpu usage because it spams this message in the logs 30 times per second is the highest I have found...

[2015-08-03 20:21:51] [BUILDMODEDRAWER] WARNING: NO SIDE recognized!!!
AndyP added a comment.Aug 4 2015, 4:44 PM

this should only point to the build mode mouse pointer pointing to "no side", while I am not sure if thats "pointing in space" or a "non rotateable" block.
In both cases, I remember a problem I had with linux,
do you have "preview block to build" on?
In Buildmode, this is almost always there, and transparent stuff can become an impact on the performance (as its on top of all others)

thakyZ added a comment.Aug 4 2015, 5:19 PM

Yes I do have "preview block to build on" on...

AndyP added a comment.Aug 4 2015, 7:20 PM

does it yield a difference when turning it off?

thakyZ added a comment.Aug 5 2015, 1:42 AM

Yes it does I tested it again when on and off again also.

Could the very act of writing to the log file be the cause of the slow-down? I mean if the draw thread is creating new string objects and outputting them to an output buffer on every single frame, then yeah... That could cause an impact depending on implementation.

This comment was removed by Rokiyo.
AndyP added a comment.Aug 6 2015, 12:31 AM

The log should not be related to video slowdown, unless the log would be live displayed ingame, but its independent from the game, however it may be related that a preview block to be drawn has no place to be drawn and thus causes issues.

Rokiyo added a comment.Aug 6 2015, 9:58 AM

Respectfully, I think you may be underestimating the impact of logging on Java's performance. This is particularly relevant if you are generating log messages during every single frame, especially considering memory-buffered loggers are somewhat rare and so you are more than likely writing that message to disk on every single frame...

In SmilingDemon's case he is dropping from 230 FPS to 125 FPS, or in other words he is going from needing 4.3 milliseconds to produce a frame to needing 8 milliseconds: We are talking about an extremely small increase in time here. Unless you have implemented asynchronous logging in your application, it is plausible that the render thread is waiting for the logging action to complete before it finishes producing each frame (and even if you were running an asynchronous logger that wasn't keeping up with the render loop then you'd just see your memory usage climbing steadily anyway).

This could also help explain the wide variance in performance drops: If the issue is a delay in the production of each frame, then SmilingDemon's completely uncapped FPS would cause him trigger this issue many more times per second than someone who has V-sync turned on or has otherwise capped their FPS. If he is also suffering from slow file I/O speeds (e.g. running StarMade off a HDD instead of a SSD, or if his SSD is running low on free space), then that would further compound the issue.

I'm not saying logging is definitely the issue, but I am saying this is a plausible theory that may warrant some consideration.

i have to agree with Rokiyo, my fps data ( http://i60.tinypic.com/ndo3ft.jpg ) also shows a approx. 4ms increase in time per frame... that is worth looking into i would guess

AndyP shifted this object from the S1 Public space to the S3 Starmade space.Aug 11 2015, 11:27 PM
AndyP changed the edit policy from "Starmade (Project)" to "All Users".
thakyZ claimed this task.Aug 13 2015, 9:28 PM

I have had some luck in this issue so I will do some more tests with different settings...

Zackey_TNT added a subscriber: Zackey_TNT.EditedAug 24 2015, 2:53 PM

Logging does impact performance nothing is done without loss however for such a game like this logs are 100% required without them no bug report would be reproducible or fixable and we would be in early access forever.

The underlying issue here is if adv build mode is causing framerate issues and not the logging of adv build mode which will be hard to test.

thakyZ closed this task as Invalid.Aug 27 2015, 8:49 PM

Already fixed not able to reproduce anymore, and as Lancake has said "but it's possible CPU usage has been decreased for build/ship mode related features due to physic optimizations."

Restricted Application removed a project: Issue Navigation. · View Herald TranscriptAug 27 2015, 8:49 PM
Restricted Application removed a subscriber: AndyP. · View Herald Transcript
AndyP removed thakyZ as the assignee of this task.Sep 7 2015, 9:05 PM
Restricted Application added a project: Engine. · View Herald TranscriptMar 10 2017, 6:31 PM