Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 4x slower CPU throttle in Chrome DevTools simulate in terms of hardware?

There may be a better forum for this question so I'm open to suggestions to move it.

If I'm using a 2017 15" MacBook Pro (2.9 GHz Intel Core i7) and I throttle the CPU to be 4 times slower in Chrome DevTools what sort of hardware am I simulating? Is it as simple as dividing the clock speed by 4, I think not...

I'm struggling to work out if this level of throttling is relevant for the app I am working on.

like image 521
hally9k Avatar asked Jun 14 '18 01:06

hally9k


1 Answers

Unfortunately the answer seem to be "it depends", but no, it does not really emulate slow hardware. One thing I'm quite certain of though -- it doesn't actually slowdown your CPU (don't change the CPU clock or anything like that). So if you have a quad core 4 GHz CPU then x4 slowdown is not the same as running a page on 1 GHz quad core CPU.

What this feature seem to do is making the main thread busy. So it will probably not affect Service Worker that much (because SW is not in the main thread). It will also not emulate your system being slower (if you would have a slower CPU then other applications would occupy more of it).

Source of my assumptions: description of "thread_cpu_throttler.h".

This class is used to slow down the main thread for inspector "cpu throttling". It does it by spawning an additional thread which frequently interrupts main thread and sleeps.

The developer writing this claims however that main thread will be X times slower here:

|rate| is a slow-down factor - passing 2.0 will make everything two times slower. Any rate less or equal to 1.0 disables throttling and cleans up helper thread.

So to conclude... For a quad core 4 GHz CPU and x4 slowdown enabled, you are emulating something slower then 4 GHz, but faster then 1 GHz quad core CPU.

like image 93
Nux Avatar answered Oct 11 '22 08:10

Nux