* Summary: This has been discussed a few times already, but basically the proposal is to expose the number of "processors" to web sites directly. This means logical processors, in our implementation, so a hypethreaded core counts as 2 processors.

The API will be a "hardwareConcurrency" property on Navigator and WorkerNavigator.

The return value will be clamped to be no larger than the max number of workers we allow to start per domain. This value is read from preferences, but is not live: it's only read once.

* Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1008453

* Link to standard: You're funny. People don't bother to put stuff into actual specs anymore. The closest we have is https://wiki.whatwg.org/wiki/NavigatorCores which does at least have some IDL and some discussion around privacy and whatnot.

* Status in other browsers: Chrome and Safari both ship this. Safari does clamping to not return values that are too big. Chrome just returns the number of processors it detects.

* Privacy concerns: The wiki linked above points out that you can already measure this if you try just a bit; it's just a bit wasteful on CPU for people who are trying to play nice and schedule actual work instead of trying to fingerprint everyone....

* Use cases: This is basically supposed to answer the "how many workers should I spin up?" question. It doesn't do a great job of that, because it turns out we can load multiple web pages all at once, but no one has come up with a better idea.

* Further notes: We can change the way we compute this number in the future if we care.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to