You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否在Chrome DevTools设置自定义CPU节流?含Lighthouse参数验证咨询

Custom CPU Throttling in Chrome 63 DevTools & Lighthouse

Great question! Let's break down your concerns one by one:

1. Does Chrome 63's DevTools Performance panel support custom CPU throttling (like 20x)?

Out of the box, Chrome 63's Performance panel only offers the three preset options: No throttling, 4x slowdown, and 6x slowdown. There's no native UI to input a custom multiplier like 20x directly in the panel.

2. Can custom throttling be achieved via chrome.exe launch flags or Node.js libraries?

Chrome.exe launch flags

Unfortunately, there's no direct launch flag in Chrome 63 to set a custom CPU throttling multiplier. Flags like --force-low-power-mode or --disable-highres-timers affect performance in general but don't let you specify an exact 20x slowdown.

Node.js libraries (e.g., Puppeteer)

Yes, you can use Puppeteer (a Node.js library that controls Chrome via the DevTools Protocol) to set any custom CPU throttling rate. Note that you'll need a Puppeteer version compatible with Chrome 63 (likely Puppeteer v1.x, since newer versions require newer Chrome builds).

Here's a quick example:

const puppeteer = require('puppeteer');

(async () => {
  // Launch Chrome 63 (specify executable path if needed)
  const browser = await puppeteer.launch({
    executablePath: 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
    headless: false, // Open visible browser to verify
    defaultViewport: null
  });

  const page = await browser.newPage();
  // Set 20x CPU throttling
  await page.emulateCPUThrottling(20);

  // Navigate to your test page
  await page.goto('https://example.com');

  // Run your tests or record performance profiles here
  // ...

  await browser.close();
})();

3. How to verify if Lighthouse's modified CPU_THROTTLE_METRICS (set to 20) is working?

If you've modified Lighthouse's default CPU_THROTTLE_METRICS from 4 to 20, here are three reliable ways to confirm it's active:

  • Check verbose logs: Run Lighthouse with the --verbose flag. Look for a log line like CPU throttling rate: 20—this confirms the multiplier was applied.
  • Inspect the Lighthouse report JSON: Export the report as JSON (using --output json flag) and look for the configSettings.cpuThrottlingMultiplier field. It should show 20.
  • Manual performance validation: Record a Performance profile while Lighthouse runs. Compare the execution time of key tasks (e.g., script evaluation, layout) against a non-throttled run. A task that takes 100ms normally should take ~2000ms with 20x throttling, which confirms the setting is working.

内容的提问来源于stack exchange,提问作者ScriptyChris

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:51:21