New issue
Advanced search Search tips
Starred by 35 users
Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment
Add support for CPU/GPU throttling in device mode
Reported by ashlaa...@gmail.com, Nov 24 2014 Back to list
UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.2 Safari/537.36

Steps to reproduce the problem:
(This is a feature request)

Chrome DevTools has a really nice feature where you can throttle the network speed to simulate slower connections like EDGE, and size the viewport as it would appear on a mobile device. However it is still able to use the full CPU and GPU performance of the system. For example, I develop on a really powerful desktop machine with a super-fast power-hungry quad-core Intel CPU and a high-end gaming graphics card that laughs at terms like "fill rate" and dims the lights a bit when it spins up. Now whether I'm developing a website, playing with animations, or working on a HTML5 game, I have all that computing power available. So I might get the viewport looking nice and the network efficient even when throttled, but I can't realistically test the performance of low-end mobile devices on that machine: I still have to go out and buy a device, connect it up, and see how it fares. Some developers can't afford to buy devices for testing, and others simply are lazy and won't test it, and will end up building sites that perform fine on their desktops but struggle on mobile.

What is the expected behavior?
If it's technically feasible, it would be great if dev tools could add a CPU and GPU throttling mode to more realistically simulate what a mobile device's computing power is like. I can see this is difficult, since the instruction sets and performance profiles of desktop x86-derived chips and low-power ARM chips may be very different, and not just linearly slower either, they will have various strengths and weaknesses. (And the same for GPUs.) Also more powerful machines will have to slow down more than weaker desktops, so some degree of profiling may be necessary.

However if there is an option to roughly get you in the right ballpark, e.g. go ~10x slower to roughly match a cheap mobile device, then we may be alerted to problems or inefficiencies that we wouldn't have otherwise spotted.

What went wrong?
Still have to buy a range of devices for testing and connect them up to a desktop/laptop for performance testing.

Did this work before? No 

Chrome version: 41.0.2228.2  Channel: canary
OS Version: 6.3
Flash Version: Shockwave Flash 15.0 r0

I guess this might not actually solve anything, since it would be difficult to make a desktop machine closely match the performance profile of a low-power mobile device, and therefore testing on real devices will probably still be essential. But it might prevent some developers assuming it will run just fine everywhere.
 
Labels: Cr-Platform-DevTools-Performance
Owner: dgozman@chromium.org
Status: Assigned
Cc: yu...@chromium.org
Yury, do you think it's possible to add CPU throttling in V8?
Comment 3 by yu...@chromium.org, Dec 11 2014
Cc: loislo@chromium.org a...@chromium.org
Ilya suggests we could leverage v8 sampling profiler infrastructure for this: when JS thread is paused just sleep for some time instead of collecting call stack.
Comment 4 by loislo@chromium.org, Jul 17 2015
Cc: -loislo@chromium.org
Labels: -Type-Bug Type-Feature
Comment 6 by echo1...@gmail.com, Oct 24 2015
Just came across this quote by Dominic Tarr: "if you want to write fast software, use a slow computer".  Having had to repeatedly impress performance impact to my team, esp. on mobile devices, it would be GRRRRREAT to get this feature added to DevTools.
Project Member Comment 7 by bugdroid1@chromium.org, Dec 12 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b41f3cfb371039ad925a5e778e3addddd8d8b2b5

commit b41f3cfb371039ad925a5e778e3addddd8d8b2b5
Author: alph <alph@chromium.org>
Date: Sat Dec 12 07:49:35 2015

DevTools: Initial implementation of slow CPU emulation.

CPU throttling uses SIGUSR2 signal handler to pause the thread.

Current limitations are:
  - throttles renderer thread only
  - POSIX only supported.

BUG= 436111 

Review URL: https://codereview.chromium.org/1521113002

Cr-Commit-Position: refs/heads/master@{#364923}

[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/content/browser/devtools/protocol/network_handler.cc
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/content/content_renderer.gypi
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/content/renderer/devtools/devtools_agent.cc
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/content/renderer/devtools/devtools_agent.h
[add] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/content/renderer/devtools/devtools_cpu_throttler.cc
[add] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/content/renderer/devtools/devtools_cpu_throttler.h
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/content/renderer/devtools/v8_sampling_profiler.cc
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/Source/devtools/front_end/main/Main.js
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/Source/devtools/protocol.json
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/Source/web/InspectorEmulationAgent.h
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h
[modify] http://crrev.com/b41f3cfb371039ad925a5e778e3addddd8d8b2b5/third_party/WebKit/public/web/WebDevToolsAgentClient.h

Comment 9 by a...@chromium.org, Dec 18 2015
 Issue 546376  has been merged into this issue.
Comment 10 by a...@chromium.org, Jan 11 2016
Cc: ranjitkan@chromium.org
 Issue 574182  has been merged into this issue.
picking up this twitter thread: https://twitter.com/getify/status/690428287261114368 …

As indicated in  issue 574182 , we're interested in ultimately shipping throttling options more like "2013 low end phone", "iPad Air (2014)", "Nexus 6P", etc. (A bit of calibration will be required, perhaps)

Until then, it's a bit of experimentation to determine what multiplier makes sense. But initial rough testing indicates that laptop -> phone is typically a 3x-7x slowdown.
Comment 12 by get...@gmail.com, Jan 24 2016
@paul thanks, fantastic feedback!
Project Member Comment 13 by bugdroid1@chromium.org, Mar 12 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cd67abe3800dba6b52a9cb4968bad29c62d42e12

commit cd67abe3800dba6b52a9cb4968bad29c62d42e12
Author: alph <alph@chromium.org>
Date: Sat Mar 12 01:02:58 2016

DevTools: Do not invoke CPU throttling on worker targets.

BUG= 436111 

Review URL: https://codereview.chromium.org/1791533003

Cr-Commit-Position: refs/heads/master@{#380816}

[modify] https://crrev.com/cd67abe3800dba6b52a9cb4968bad29c62d42e12/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Project Member Comment 14 by bugdroid1@chromium.org, May 8 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5f1d704d671ca80af36a67c6899ab846b2397254

commit 5f1d704d671ca80af36a67c6899ab846b2397254
Author: alph <alph@chromium.org>
Date: Sun May 08 15:18:04 2016

DevTools: Introduce device dependent CPU throttling rates.

NOTRY=true
BUG= 436111 

Review-Url: https://codereview.chromium.org/1959783002
Cr-Commit-Position: refs/heads/master@{#392277}

[modify] https://crrev.com/5f1d704d671ca80af36a67c6899ab846b2397254/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Project Member Comment 15 by bugdroid1@chromium.org, May 13 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9247a041a73ba84bc456ca35e3592e378b2b4f36

commit 9247a041a73ba84bc456ca35e3592e378b2b4f36
Author: alph <alph@chromium.org>
Date: Fri May 13 22:00:37 2016

DevTools: Make the CPU throttling a non-hidden experiment.

BUG= 436111 

Review-Url: https://codereview.chromium.org/1973413002
Cr-Commit-Position: refs/heads/master@{#393653}

[modify] https://crrev.com/9247a041a73ba84bc456ca35e3592e378b2b4f36/third_party/WebKit/Source/devtools/front_end/main/Main.js

Project Member Comment 16 by bugdroid1@chromium.org, May 13 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f77e08f979f9ab5efcab7349fbf1fec1c6e51a49

commit f77e08f979f9ab5efcab7349fbf1fec1c6e51a49
Author: alph <alph@chromium.org>
Date: Fri May 13 22:56:23 2016

Support CPU throttling on Windows

BUG= 436111 

Review-Url: https://codereview.chromium.org/1977693002
Cr-Commit-Position: refs/heads/master@{#393670}

[modify] https://crrev.com/f77e08f979f9ab5efcab7349fbf1fec1c6e51a49/content/renderer/devtools/devtools_cpu_throttler.cc

Labeling CPU throttling does make sense but please add custom throttle options just like network throttling has, we really need this because we run Octane, Jetstream and kraken benchmarks on new and old mobile devices to know the relative slowness in the devices and then build our web architecture according to that, not have the option to dial in exact slowness will make this feature restrictive, hence defeat the purpose.
Project Member Comment 19 by bugdroid1@chromium.org, Aug 13 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f5fc4bb4629a1c4d621944eb2cf471eb98010a09

commit f5fc4bb4629a1c4d621944eb2cf471eb98010a09
Author: alph <alph@chromium.org>
Date: Sat Aug 13 19:50:22 2016

DevTools: Show warning icon on the tab strip when CPU throttling is enabled.

BUG= 436111 

Review-Url: https://codereview.chromium.org/2246463003
Cr-Commit-Position: refs/heads/master@{#411901}

[modify] https://crrev.com/f5fc4bb4629a1c4d621944eb2cf471eb98010a09/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Project Member Comment 20 by bugdroid1@chromium.org, Aug 14 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4f51aa431b62ee3db85264b5db50b965943b18d0

commit 4f51aa431b62ee3db85264b5db50b965943b18d0
Author: alph <alph@chromium.org>
Date: Sun Aug 14 02:02:03 2016

DevTools: Do not remove custom CPU throttling value.

BUG= 436111 

Review-Url: https://codereview.chromium.org/2243043002
Cr-Commit-Position: refs/heads/master@{#411906}

[modify] https://crrev.com/4f51aa431b62ee3db85264b5db50b965943b18d0/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Comment 22 by a...@chromium.org, Aug 23 2016
Status: Fixed
Sign in to add a comment