WICG / WICG/cpu-performance

Unknown value of 0 means "assume slow" but example shows "assume fast"

Open
#5 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
37
Forks
7
PR merge metrics
No merged PRs in 30d

Description

I can image websites progressively enhancing with effects using code such as:

const minCpuLevel = 2;
if (navigator.cpuPerformance > minCpuLevel) {
  // add sparkles
}

But for any devices with unknown value of 0, this would not be enabled, unless explicitly tested for.

Should the Unknown special value be some large constant or Number.MAX_SAFE_INTEGER?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the issue's JavaScript example and the stated unknown value of 0. Resolve whether the unknown value should preserve the example's comparison behavior or use a large sentinel, then align the API specification and examples; done when the unknown-value rule is unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.