Web client room view pegging CPU/browser always
-
Hi,
The web client's room view (including the simulator) peg the browser hard enough that independent windows/tabs are nearly nonfunctional while the screeps room view is visible. Switch the tab or minimize the window and it's fine again (with the websockets still being read)
This drains battery on a laptop, makes my desktop NUC run fans fullspeed, and generally wastes electricity.
A chrome timeline shows half of the time is spent in a JS loop, and the other half in chrome rendering (Update Layer Tree and Recalculate Style being the big two). The CPU usage is constant, even if the server isn't supplying ticks momentarily.
I assume you're aware of this? Anything we can bribe with to get the client to chill out a little? I'd love to spend more time with the simulator (or just watching my creeps) on a battery or without listening to a desk jet engine.
None of the other pages seem to have this trouble (ie; world view, summary pages with room preview boxes).
I'm on chrome on various versions of linux, but I also tried chrome on windows 10 and had the same issue. I've tried on 3 very different CPU's. Rendering speed feels the same but it pegs a core just as well.
Thanks!
-
Can confirm this:
CPU usage is through the roof:
http://i.imgur.com/uqe47NT.png
Comparison without a single screeps tab open:
-
It's due to the css animations.
Example if you add:
transform: translateZ(0);
To their .creep.anim-active.speed50 css class you''ll notice the cpu usage drop by a lot (for me from 45% to 11%)
See this post for more info http://stackoverflow.com/questions/13176746/css-keyframe-animation-cpu-usage-is-high-should-it-be-this-way
-
The animations are quite a lot but I have a feeling something else is going on. Even if there's nothing animating for several seconds the CPU stays pegged. Either it's (still?) catching up or it's re-applying changes to the style needlessly and causing redraws.
-
We’ve deployed some animation optimizations (including
translateZ(0)
force switch), please confirm if you see any improvement.
-
In the simulator, while paused, still uses 1 core fully on my computer.
-
Can we have a look at the screenshot of your room layout in the simulator at that moment?
-
http://i.imgur.com/pPjHLHa.png
You can use this script to magically load any room into the simulator:
https://github.com/ButAds/SimulationRoomLoader
It's room W3N11 from the world.
-
Does displaying the real W3N11 room produce the same thing?
-
-
I'm unable to reproduce this. Have you tried an incognito window setup without any extensions/userscripts?
-
In incognito:
http://i.imgur.com/xAKdkhI.png
Might be related that
transform: translateZ(0);
is not handled by GPU's if they don't support it.
-
In the paused simulation room it doesn't matter, there should be no position transforms. Could you try to start removing all object types (towers, spawns, etc) from the sim room and check if this makes it any better?
-
I got it down to 6% CPU after removing the following structures:
Spawn
Tower
Observer
Powerspawn
Sources
-
-
Any particular structure type? Or all of these should be removed altogether?
-
Narrowed it down to the following:
Active Spawners
Energy sources
Observer
Adding either of these to the room increases CPU to a full core.
-
As soon as tower start rotating around it will immediately jump to 1 full CPU as well.
-
So, basically, all elements with active SVG animations, which is very strange. There are some serious issues with them in your browser setup. Let's move this debugging session to private, please create a support ticket.
-
Artem if you add translateZ(0) you have to make sure the draw order is correct. Right now containers is draw on top of creeps.
-
Artem if you add translateZ(0) you have to make sure the draw order is correct. Right now containers is draw on top of creeps.
There was a typo in
z-index
style which is already fixed. Try to reload the page.