Skip to content

High CPU Spike / UI Stutter on Single GM_xmlhttpRequest Call #2731

@neilmahaseth

Description

@neilmahaseth

Calling GM_xmlhttpRequest even at a low frequency (once every 10 seconds) causes a noticeable CPU spike (~50%) in Chrome’s internal task manager and results in visible UI stutter/freezing for a short duration.
This behavior occurs even with a minimal request and no heavy processing in the callback.

Actual Behavior

  • CPU spike (~40–50%) in Chrome Task Manager when Calling GM_xmlhttpRequest
  • Short UI stutter/freezing during execution
  • Issue occurs even without response processing or DOM manipulation

Expected Behavior

  • Minimal CPU usage for a simple HTTP GET request
  • No visible UI stutter or freezing
  • Behavior similar to native fetch()

Steps to reproduce the issue

  1. Install Tampermonkey
  2. Add the bellow mentioded minimal userscript
  3. Open www.google.com
  4. Open Chrome Task Manager (Shift + Esc)
  5. Observe CPU usage and UI behavior when request fires

Environment

  • Browser and Version: Chrome 146.0.7680.154 (Official Build) (64-bit)
  • Tampermonkey version:5.4.1
  • Operating System and Version: Windows 10 10.0.19045 Build 19045

Script

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      2026-03-22
// @description  try to take over the world!
// @author       You
// @match        https://www.google.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant        GM_xmlhttpRequest
// @connect      httpbin.org
// ==/UserScript==

(function() {
    'use strict';
setInterval(() => {
  GM_xmlhttpRequest({
    method: "GET",
    url: "https://httpbin.org/get",
    onload: () => console.log("done"),
    onerror: (err) => console.error("error", err),
  });
}, 10000); // 10 seconds
    // Your code here...
})();

Additional context

  • The spike is not visible in Windows Task Manager, indicating short-lived internal thread blocking rather than sustained CPU usage
  • Issue persists even at low frequency (10s interval)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions