0

I have created a multiplayer game that uses webRTC for communication. It sends 4.8 KB data every second. Can sending this data cause high CPU usage? I'm wanted to run the game in browser so i used electron just to run the game. But before any data sending to other client the electron app uses about 0.1% (on windows) and 1.7% (on linux) of cpu (4-core , i5 3570) but as soon as i start sending data the cpu usage spikes 4.5 % (on windows) and (25% on linux).

Linux - (Ubuntu 18.04) CPU - i5 3570

So what might be the reason of such variation in CPU usage of windows and linux. Why CPU spike on sending data.

  • What is involved in the sending of the data? How and what are you generating, or are you simply fetching already existing data? – Jesse Schokker Jul 26 '19 at 10:26
  • are you sure that Electron is causing that spike? Does that happen more than once? – Jonas Wilms Jul 26 '19 at 10:27
  • I have already use ```peerjs``` and now ```easyRTC``` both have similar issues. ```JSON data stringify ed``` data is sent. data is from the game engine's output. whatever the operation is performed by the game engine the resulting output is sent to the other peer. – Atish Abhang Jul 26 '19 at 10:29
  • I have also use ```Qt``` , ```NW.js``` ```Qtpy``` electron is the only that has lowest cpu utilization. – Atish Abhang Jul 26 '19 at 10:34
  • I think it's the Chromium. Is there a possibility that high bandwidth usage cause the CPU spike? – Atish Abhang Jul 26 '19 at 14:35

0 Answers0