Skip to content

CPU hot plugging #18

Open
Open

Description

@nickie

In its present form, this API assumes that CPU information (i.e., the CPU model and number of cores) does not change with time. This is not necessarily true, in the presence of CPU hot plugging, which amounts to adding or removing processing units, physically or virtually, while the computer system remains operational. Virtualization platforms typically offer this functionality, but an operating system may also arbitrarily decide to enable or disable CPU units, so that the reported number of logical cores changes.

If CPU information changes, it is probably expected that the value reported by navigator.cpuPerformance may also change.

Furthermore, if CPU hot plugging represents a significant use case, maybe it makes sense to add some observer to this API, similarly to what the Compute Pressure API does.

I am opening this here for discussion.
[This was first mentioned by Sangwhan Moon here.]

Activity

  1. tunetheweb commented on Jul 21, 2026

    @tunetheweb
    Contributor

    To me this gets to the heart of the issue of the difference between this API (static) and the Compute Pressure API (dynamic).

    IMHO, if the website/developer wants to react to changes in the environment (including hot plugging), then the Compute Pressure API is the API for that (whether in addition to this API or instead of).

    While I can see the value in clear/binary cases (like hot plugging), I think adding an observer to this API overlaps too much with the Compute Pressure API and risks adding developer confusion is to the difference in these two APIs.

    There is lots of precedent with taking a snapshot at a time (typically page load) and then NOT updating later (e.g. Data Saver, Effective Connection Type, DPR on loading a website on one screen, and the moving it to another, higher resolution screen). Site owners/developer can choose to re-read those if they wish but no observer exists for them as far as I'm aware and not sure this needs one, when we already have an alternative dynamic API for that use case.

    I also think best practice would be to allow a user to override a setting anyway (e.g. if the UI is in a "lite mode", then users should ideally be able to switch to "full mode" even if the code has decided that may not be optimum for them), and that could also be invoked in the hot plugging use case.

    So while I think the value returned by navigator.cpuPerformance should probably update, I don't think we necessarily need an observer for this. Unless we hear a specific ask for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions