Home > Software design >  My ReactJS app in Chrome Task Manager CPU is High but Windows Task Manage is low. Why?
My ReactJS app in Chrome Task Manager CPU is High but Windows Task Manage is low. Why?

Time:12-25

I'm using Reactjs to create a dashboard site that has about 15 different data grids that update every 500ms via websockets with a large amount of data virtualized per grid (7k records). Performance seems great on multiple lower / higher end machines (tested 5 different pc's and 1 mac) and the app also performs well in firefox safari and Edge.

My concern is that when I open Chrome's task manager it says CPU usage is anywhere from 50 to 120; however, if I look at the windows task manager, CPU usage for chrome is only at 4-5%. It would seem that the values in the chrome task manager don't correlate to the Windows Task Manager.

On chromes dev site at https://developer.chrome.com/docs/extensions/reference/processes/ it says "The most recent measurement of the process’s CPU usage, expressed as the percentage of a single CPU core used in total, by all of the process’s threads. This gives a value from zero to CpuInfo.numOfProcessors*100, which can exceed 100% in multi-threaded processes. Only available when receiving the object as part of a callback from onUpdated or onUpdatedWithMemory."

Do I need to worry if chrome says my reactjs app is 50-120 CPU? What is it exactly that the chrome task manager measures in regards to CPU usage and how are these values calculated, I don't understand the above linked text? Is there a better way to measure true CPU usage of my reactjs app?

Thank you.

CodePudding user response:

If you have 8 cores then the max CPU in Chrome is 800%, whereas in Windows it would be 100%. So a full consumed CPU core would be 100% in Chrome and 100%/8 = 12.5% in Task Manager.

50 % cpu in Chrome would then equal 6.25% CPU in Task Explorer, so it might add up fine.

Having a single CPU core running at 50-100% cpu means you are doing crazy amounts of work. Which might be fine. But mobile users, including ones using a laptop on the go, will hate you for killing their battery.

  • Related