Just realised today that I don't really know how CPU throttling works in Chrome DevTools. Does it slow down just the JavaScript parts or exposed native APIs too? What about V8 internals like parsing/compilation?
-
-
Thanks!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
(For those that don't want to read the code): it adds a signal handler to the main thread, then creates a new thread that periodically sends signals to the main thread. When the main thread receives the signal, it will spin loop for some time (as described above), then resume.
-
On Windows it uses SuspendThread/ResumeThread instead of signals. Spin looping is used for higher precision (according to the comments), but will use more CPU. Because it works at thread granularity, it should affect all code running on that thread, not just JavaScript.
End of conversation
New conversation -
-
-
Indeed. I like to point this out to folks when CPU throttling kills their battery at conferences (lol
@kristoferbaxter) -
Just need a bigger battery! Context: I leave CPU/Network throttling on always for the current tab used for development.
- 1 more reply
New conversation -
-
-
This means that native APIs are affected too?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
is it just for the main thread?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.