October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

ONNX Runtime Web `numThreads` Falls Back to 1 Without Cross-Origin Isolation

A multithreaded WASM request cannot override a page’s lack of cross-origin isolation. Here’s how to detect the fallback, configure COOP/COEP, and benchmark your deployment.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If ONNX Runtime Web is asked to use multiple WebAssembly threads on a page that is not cross-origin isolated, the runtime can continue with one thread instead. In a benchmark reported by hao jia on September 29, 2026, the four-thread request without isolation took a median 6,318 ms, close to the 6,313 ms isolated single-thread result; four threads with isolation took 2,133 ms. Those are results for one specific setup, not a general speedup guarantee.

Why does `numThreads = 4` still run on one thread?

`numThreads` is a request, not a way to make an unsupported browser environment provide WebAssembly multithreading. ONNX Runtime Web’s documented requirements are browser support for WebAssembly multithreading and an enabled `crossOriginIsolated` mode. When the runtime detects that multithreading is unavailable despite a request for more than one thread, its current upstream implementation warns and resets the effective count to one before initialization. The source warning is: “WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.”

The flag documentation also clarifies that the count includes the main thread: a value of one disables multithreading. A value of zero delegates thread selection to the environment; the documented browser choice is half of `navigator.hardwareConcurrency` or four, whichever is smaller. Set the flag before creating the inference session. The implementation and warning are from the mutable upstream `main` branch, so behavior and wording may change between releases.

Sources: ONNX Runtime WebAssembly flags documentation and upstream WASM factory source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
  • The world’s fastest gaming processor, built on AMD ‘Zen5’ technology and Next Gen 3D V-Cache.
  • 8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency
  • 96MB L3 cache with better thermal performance vs. previous gen and allowing higher clock speeds, up to 5.2GHz
  • Drop-in ready for proven Socket AM5 infrastructure
  • Cooler not included

What do COOP and COEP change?

Cross-origin isolation is a browser page state, not an ONNX Runtime setting. A cited reproduction enabled it by serving these response headers on the page:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

In that reproduction, `crossOriginIsolated` became true when both headers were sent and false when neither was sent. The exact policy needed in production depends on the page and its cross-origin resources, so test the actual deployed page rather than assuming the development server’s state carries over. Check `globalThis.crossOriginIsolated` in the browser console, and inspect response headers at the layer that serves the page, such as the web server or CDN.

Rank #2
Sale
AMD Ryzen 9 9950X3D 16-Core Processor
  • AMD Ryzen 9 9950X3D Gaming and Content Creation Processor
  • Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
  • Form Factor: Desktops , Boxed Processor
  • Architecture: Zen 5; Former Codename: Granite Ridge AM5

Source: hao jia’s benchmark and reproduction.

How large was the reported performance difference?

In the author-reported benchmark posted September 29, 2026, the setup was `onnxruntime-web` 1.27.0, an ISNet INT8 model, a 1024 × 1024 input, an Apple M4 with 16 GB of memory, and an open-source Chromium 149 build. The measurements below are median steady-state inference times reported for that setup.

Page state and setting Reported median
Cross-origin isolated; four threads 2,133 ms
Not cross-origin isolated; four threads requested, runtime falls back to one 6,318 ms
Cross-origin isolated; one thread 6,313 ms

The non-isolated run completed without an exception, printed two warnings, and was close to the isolated one-thread result. This supports the diagnosis that a successful inference call does not prove the requested thread count took effect. It does not establish how often this occurs across deployments, or a universal speedup ratio: the figures are one developer’s benchmark, not an independently replicated study.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
  • Can deliver fast 100 plus FPS performance in the world's most popular games, discrete graphics card required
  • 6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler
  • 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
  • For the advanced Socket AM4 platform

Source: benchmark details and results.

How can you make degraded mode visible?

Choose an explicit count from the page’s isolation state before creating the session, and send an application-owned diagnostic to your logging or telemetry system when isolation is unavailable. That gives you a visible signal beyond a browser console warning and makes the intended configuration inspectable.

ort.env.wasm.numThreads = globalThis.crossOriginIsolated ? 4 : 1;

if (!globalThis.crossOriginIsolated) {
  // Replace with your application's logging or telemetry call.
  console.warn("Cross-origin isolation is unavailable; using one WASM thread.");
}

const session = await ort.InferenceSession.create(modelUrl);

The four-thread choice above is an example matching the cited benchmark, not a universal optimum. The report observed `{ isolated: true, threads: 4 }` on its isolated test server and `{ isolated: false, threads: 1 }` on the other. In your application, verify the actual deployment state and monitor the diagnostic; do not infer effective threading solely from the configured value.

Rank #4
Sale
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
  • Pure gaming performance with smooth 100+ FPS in the world's most popular games
  • 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
  • 5.4 GHz Max Boost, unlocked for overclocking, 38 MB cache, DDR5-5600 support
  • For the state-of-the-art Socket AM5 platform, can support PCIe 5.0 on select motherboards
  • Cooler not included

Source: tested configuration and mitigation.

How should you verify the performance impact?

  • Confirm `globalThis.crossOriginIsolated` on the page where inference runs.
  • Record the requested thread count and the isolation state alongside application telemetry.
  • Compare the same model, input dimensions, execution provider, browser, device, and deployment conditions.
  • Measure warm or steady-state inference consistently; do not compare a cold start with a warmed run.
  • Test the configuration users actually receive, including the production response headers and relevant cross-origin resources.

There is no source-backed universal best thread count or general speedup figure. The right choice depends on the environment and workload being measured.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does this affect WebGPU or proxy workers?

The reported fallback is about WebAssembly threading. ONNX Runtime documents WASM as its default CPU provider and WebGPU as a distinct execution provider. In the same author-reported test, WebGPU medians were 355 ms without isolation and 359 ms with isolation. That limited comparison does not prove WebGPU is always unaffected by isolation; test the provider and deployment you use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
  • Processor provides dependable and fast execution of tasks with maximum efficiency.Graphics Frequency : 2200 MHZ.Number of CPU Cores : 8. Maximum Operating Temperature (Tjmax) : 89°C.
  • Ryzen 7 product line processor for better usability and increased efficiency
  • 5 nm process technology for reliable performance with maximum productivity
  • Octa-core (8 Core) processor core allows multitasking with great reliability and fast processing speed
  • 8 MB L2 plus 96 MB L3 cache memory provides excellent hit rate in short access time enabling improved system performance

A proxy worker is a separate option aimed at keeping heavy work from blocking the main thread, which can improve UI responsiveness. ONNX Runtime’s performance guidance does not describe it as a way to improve model performance, and it does not fix the missing cross-origin isolation needed for WASM multithreading. The flag documentation also notes proxy-worker limitations with WebGPU and pages restricted by Content Security Policy.

Sources: WebAssembly flags documentation, performance and threading guidance, environment flags and session options, and benchmark report.

Quick Recap

SaleBestseller No. 1
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
AMD RYZEN 7 9800X3D 8-Core, 16-Thread Desktop Processor
8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency; Drop-in ready for proven Socket AM5 infrastructure
$447.15
SaleBestseller No. 2
AMD Ryzen 9 9950X3D 16-Core Processor
AMD Ryzen 9 9950X3D 16-Core Processor
AMD Ryzen 9 9950X3D Gaming and Content Creation Processor; Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
$659.99
SaleBestseller No. 3
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
AMD Ryzen 5 5500 6-Core, 12-Thread Unlocked Desktop Processor with Wraith Stealth Cooler
6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler; 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
$87.95
SaleBestseller No. 4
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
AMD Ryzen™ 5 9600X 6-Core, 12-Thread Unlocked Desktop Processor
Pure gaming performance with smooth 100+ FPS in the world's most popular games; 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
$174.00
SaleBestseller No. 5
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
AMD Ryzen 7 7800X3D 8-Core, 16-Thread Desktop Processor
Ryzen 7 product line processor for better usability and increased efficiency; 5 nm process technology for reliable performance with maximum productivity
$348.00

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.