Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-21 Thread Dao
On 21.05.2014 01:27, Rik Cabanier wrote: Likewise here. I don't think anyone is saying that hardwareConcurrency is failing on the grounds of exposing too much system information alone. The way I read this thread, people either aren't convinced that it's the right compromise given its usefulness,

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-20 Thread Gavin Sharp
I think it might help your case to acknowledge the often significant difference between technically possible, but expensive and unreliable and extremely simple and 100% reliable. That something is already technically possible does not mean that making it easier has no consequences. Arguing that

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-19 Thread Jonas Sicking
On Mon, May 12, 2014 at 5:03 PM, Rik Cabanier caban...@gmail.com wrote: Primary eng emails caban...@adobe.com, bugm...@eligrey.com *Proposal* http://wiki.whatwg.org/wiki/NavigatorCores *Summary* Expose a property on navigator called hardwareConcurrency that returns the number of logical

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-19 Thread Benoit Jacob
+1000! Thanks for articulating so clearly the difference between the Web-as-an-application-platform and other application platforms. Benoit 2014-05-19 21:35 GMT-04:00 Jonas Sicking jo...@sicking.cc: On Mon, May 19, 2014 at 4:10 PM, Rik Cabanier caban...@gmail.com wrote: I don't see why

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-19 Thread Rik Cabanier
On Mon, May 19, 2014 at 6:35 PM, Jonas Sicking jo...@sicking.cc wrote: On Mon, May 19, 2014 at 4:10 PM, Rik Cabanier caban...@gmail.com wrote: I don't see why the web platform is special here and we should trust that authors can do the right thing. I'm fairly sure people have already

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-19 Thread Rik Cabanier
On Mon, May 19, 2014 at 6:46 PM, Benoit Jacob jacob.benoi...@gmail.comwrote: +1000! Thanks for articulating so clearly the difference between the Web-as-an-application-platform and other application platforms. It really surprises me that you would make this objection. WebGL certainly would

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-18 Thread Rik Cabanier
FYI this attribute landed in WebKit today: http://trac.webkit.org/changeset/169017 On Thu, May 15, 2014 at 1:26 AM, Rik Cabanier caban...@gmail.com wrote: On Wed, May 14, 2014 at 11:39 AM, Ehsan Akhgari ehsan.akhg...@gmail.comwrote: On 2014-05-13, 9:01 PM, Rik Cabanier wrote: ...

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-18 Thread Xidorn Quan
IMO, though we may have a better model in the future, it is at least not harmful to have such attribute with some limitation. The WebKit guys think it is not a fingerprinting when limiting the max value to 8. I think it might be meaningful to also limit the number to power of 2 (very few people

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-18 Thread Rik Cabanier
On Sun, May 18, 2014 at 4:51 PM, Xidorn Quan quanxunz...@gmail.com wrote: IMO, though we may have a better model in the future, it is at least not harmful to have such attribute with some limitation. The WebKit guys think it is not a fingerprinting when limiting the max value to 8. I think it

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-16 Thread lrbabe
Do you think it would be feasible that the browser fires events every time the number of cores available for a job changes? That might allow to build an efficient event-based worker pool. In the meantime, there are developers out there who are downloading micro-benchmarks on every client to

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-16 Thread lrbabe
Here's the naive worker pool implementation I was thinking about. It requires that the browser fires an event everytime a core becomes available (only in an active tab of course), and provide a property that tells whether or not a core is available at a given time: // a handler that runs when

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-16 Thread Rik Cabanier
On Fri, May 16, 2014 at 11:03 AM, lrb...@gmail.com wrote: Do you think it would be feasible that the browser fires events every time the number of cores available for a job changes? That might allow to build an efficient event-based worker pool. I think this will be very noisy and might

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-16 Thread lrbabe
Do you think it would be feasible that the browser fires events every time the number of cores available for a job changes? That might allow to build an efficient event-based worker pool. I think this will be very noisy and might cause a lot of confusion. Also I'm unsure how we could

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-15 Thread Rik Cabanier
On Wed, May 14, 2014 at 11:39 AM, Ehsan Akhgari ehsan.akhg...@gmail.comwrote: On 2014-05-13, 9:01 PM, Rik Cabanier wrote: ... The problem is that the API doesn't really make it obvious that you're not supposed to take the value that the getter returns and just spawn N workers.

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-15 Thread Ben Kelly
On May 15, 2014, at 1:26 AM, Rik Cabanier caban...@gmail.com wrote: On Wed, May 14, 2014 at 11:39 AM, Ehsan Akhgari ehsan.akhg...@gmail.comwrote: ... Make it possible for authors to make a semi-informed decision on how to divide the work among workers. That can already be done

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-14 Thread Ehsan Akhgari
On 2014-05-13, 9:01 PM, Rik Cabanier wrote: On Tue, May 13, 2014 at 3:16 PM, Ehsan Akhgari ehsan.akhg...@gmail.com mailto:ehsan.akhg...@gmail.com wrote: ... That is not the point of this attribute. It's just a hint for the author so he can tune his

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Rik Cabanier
On Tue, May 13, 2014 at 8:20 AM, Ehsan Akhgari ehsan.akhg...@gmail.comwrote: On Tue, May 13, 2014 at 2:37 AM, Rik Cabanier caban...@gmail.com wrote: On Mon, May 12, 2014 at 10:15 PM, Joshua Cranmer  pidgeo...@gmail.com wrote: On 5/12/2014 7:03 PM, Rik Cabanier wrote: *Concerns*

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Tom Schuster
I recently saw this bug about implementing navigator.getFeature, wouldn't it make sense for this to be like hardware.memory, but hardware.cores? On Tue, May 13, 2014 at 6:25 PM, Rik Cabanier caban...@gmail.com wrote: On Tue, May 13, 2014 at 8:20 AM, Ehsan Akhgari ehsan.akhg...@gmail.com

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Ehsan Akhgari
On 2014-05-13, 9:55 AM, Tom Schuster wrote: I recently saw this bug about implementing navigator.getFeature, wouldn't it make sense for this to be like hardware.memory, but hardware.cores? No, because that would have all of the same issues as the current API. Cheers, Ehsan

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Ehsan Akhgari
On 2014-05-13, 10:54 AM, Eli Grey wrote: On Tue, May 13, 2014 at 1:43 PM, Ehsan Akhgari ehsan.akhg...@gmail.com wrote: supporting a worker pool that actually scales to how many cores you have available 1) What is an available core to you? An available core to me is a core that I can use to

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Eli Grey
On Tue, May 13, 2014 at 1:43 PM, Ehsan Akhgari ehsan.akhg...@gmail.com wrote: supporting a worker pool that actually scales to how many cores you have available 1) What is an available core to you? An available core to me is a core that I can use to compute. A core under load (even 100% load)

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Eli Grey
On Tue, May 13, 2014 at 1:57 PM, Ehsan Akhgari ehsan.akhg...@gmail.com wrote: No, you're wrong. An available core is a core which your application can use to run computations on. If another code is already keeping it busy with a higher priority, it's unavailable by definition. Run this

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Kip Gilbert
Just wish to throw in my 2c... Many game engines will query the core count to determine if they should follow a simple (one main thread, one render thread, one audio thread, one streamer thread) or more parallel (multiple render threads, multiple audio threads, gameplay/physics/ai broken up

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Ehsan Akhgari
On 2014-05-13, 11:14 AM, Eli Grey wrote: On Tue, May 13, 2014 at 1:57 PM, Ehsan Akhgari ehsan.akhg...@gmail.com mailto:ehsan.akhg...@gmail.com wrote: No, you're wrong. An available core is a core which your application can use to run computations on. If another code is already

Re: Intent to implement and ship: navigator.hardwareConcurrency

2014-05-13 Thread Xidorn Quan
As the main usage of this number is to maintain a fixed thread pool, I feel it might be better to have a higher level API, such as worker pool. I do agree that thread pool is very useful, but exposing the number of cores directly seems not to be the best solution. We could have a better