Re: [w3ctag/design-reviews] Incubation: CPU Performance API (Issue #1198)

jyasskin left a comment (w3ctag/design-reviews#1198)

Thanks for your patience. We're convinced that:
1. There are user-serving use cases for an ability to avoid sending code to clients that could never execute JS or Wasm above a certain speed.
2. Implementations can plausibly interoperate by treating the `cpu_performance.js` code as part of the standard.
3. This isn't likely to make fingerprinting noticeably worse, given sites' existing ability to run a benchmark.

We still have several concerns about the API:

1. We're concerned that websites will use this API when they really want to filter for a particular GPU or NPU level, or hardware support for certain media formats or effects. This would give the wrong answer for users with unusual systems. The fact that the explainer and specification list "the resolution and format for images and video", "if advanced video effects can be rendered", and "whether to attempt running AI tasks locally" makes us think that this kind of mis-use is actually what the first adopters intend, which is a problem for the API itself. We wouldn't be worried about this if the specification and explainer **explicitly said that this API wasn't for those purposes, and gave alternative code** that achieved the real goals of those use cases.
1. It's surprising that the core measurement for "CPU performance tier" is based on the parallelism available on the user's machine (which is already available through [`navigator.hardwareConcurrency`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/hardwareConcurrency)), especially since Javascript is single-threaded by default. Could the specification describe the underlying goal metric here? Is it MIPS? FLOPS? Hashes/second? Something else?
1. Generally a return value that means "unknown" should be a different type from normal values, unless it's very clear that the value for "unknown" gives the right defaults. That is, `0` should only be the encoding of "unknown", when the normal values are `1`, `2`, etc., if almost every use case wants "unknown" to be treated as the least-capable CPU. We suspect that's not the case here, so "unknown" should be another type of value, such as `null` or a dedicated sentinel value. We apologize for not calling that out earlier.

We see that this shipped in Chromium in July, but we hope that you can still make some changes to help other engines ship it in a better form.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1198#issuecomment-7110049616
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1198/7110049616@github.com>

Received on Monday, 23 November 2026 18:22:38 UTC