General Category => General Discussion => Topic started by: Sowosamma on December 07, 2016, 07:31:06 am
Title: CPU - Cooking
Post by: Sowosamma on December 07, 2016, 07:31:06 am
While Ships2Career ran on my computer, I was noticed by loud noise of the fans on a relatively high CPU load. In the following, I investigated which states of the simulation cause CPU and memory loads, and how they are affected by different browsers. For comparison, my standard Firefox browser and the Edge browser, delivered with the operating system, were available.
To get comparable data, I booted the computer before testing different browsers every time, cleared cookies, and emptied the cache. The simulation always ran with the same ship, at the same position, at the same speed.
It turned out that there is no difference between 'full screen' and 'windowed' within the same browser, there is no difference between 'Map View' and 'Satellite View'. But in 'Tracking Mode' a higher CPU load is to be noted, because the whole map must be moved (which also depends on the zoom factor). Even when I quickly moved the map over a larger area manually, no higher load was found than in the 'Tracking Mode'.
There is a clear difference, however, among the different browsers, whereas Ships2Career in Firefox generates 30 - 40% CPU load, the edge browser is satisfied with 13 - 20%.
The data: Computer: Terra, with Intel i5-3570K @ 3.4 GHz, 64 bit, 8GB RAM, OS: Windows 10 Home, version 1607, Build14393.447 Graphics: NVIDIA GeForce GTX 660
Browser: Firefox 50.0.1 Edge 38.14393
Ships2Career: Anonymous mode Stena Brittanica, outside the port of Dover, at full speed, course 135 °
This shows how different HTML code is implemented in the different browsers. I also did other tests with both browsers and got quite different results, with Edge gaining a small advantage. It was tested with Penguin Mark, Basemark, BMark, CanvasMark, and AnTuTu HTML5 test. In addition, I looked to the kernels, and saw totally different loads on them.
Has anyone had similar experiences, or even figures for comparison?
Is the Ships2 code uniform, or optimized for specific browsers?
Or does nobody wants to be bored with this stuff?
Title: Re: CPU - Cooking
Post by: dinther on December 22, 2016, 01:35:16 pm
It be interesting to see the chrome numbers. It is claimed Chrome uses a lot of CPU power. But the game is absolutely hammering the CPU. This is because it uses the "requestAnimationFrame" API call. This call allows a computer to complete drawing a frame in the browser and then executes the next simulation cycle. Faster CPU's will run at a higher frame rate but capped at 60 fps.
Code is not optimized for a specific browser although my principal browser on which I develop is Chrome.
Title: Re: CPU - Cooking
Post by: Sowosamma on March 15, 2017, 08:32:46 am
Meanwhile, running Firefox 52.0, the values got much better: Same condition as in thread start, and Firefox shows 3-5 % in free mode, and about 10% in tracking mode. And in contrary to before, where Firefox used almost only one CPU, now the load is distributed equally to all 4 CPU-Kernels.