Re: CPU core count game!

2018-04-09 Thread Ehsan Akhgari
On Sat, Mar 31, 2018 at 10:12 AM Steve Fink  wrote:

> Yes, sorry, a couple of people pointed that out to me privately. And I
> did get that mixed up; I was assuming processors, despite the page
> specifically pointing out "physical cores".
>
> I still think there's something to be kept in mind here, though. Even
> with 4 processors (2 hyperthreaded cores or whatever), it's never
> correct to assume that running something on a different thread is a gold
> bullet for performance problems. I'm all for increasing the concurrency
> of our code as long as we ensure that it doesn't hurt in the case of low
> levels of actual parallelism.
>
> What that means in practice, I'm not entirely sure, but it does seem
> like we should be more conscious about thread priorities and global
> thread pool management. Also, lock contention is a real thing. It has
> been coming up here and there and wiping out parallelization gains.
>

We have bug 1366358 filed about properly specifying thread priorities,
which is especially important for systems with lower number of cores.

Last year during the Quantum Flow project we came across various bugs which
manifested as various threads running at a higher priority than some very
important thread (such as the compositor thread) resulting in situations
where we couldn't run any code on the compositor thread for several frames
which show up as whole-UI jank.

I think fixing the dependencies of that bug is a good systematic protection
against bad performance situations like that.


>
> On 3/28/18 10:27 AM, Ben Kelly wrote:
> > That page says "physical cores", so its not taking into account hyper
> > threading, right?  So even a high end macbook pro falls in that category?
> >
> > On Tue, Mar 27, 2018 at 5:02 PM, Mike Conley  > > wrote:
> >
> > Thanks for drawing attention to this, sfink.
> >
> > This is likely to become more important as we continue to scale up
> our
> > parallelization with content processes and threads.
> >
> > On 21 March 2018 at 14:54, Steve Fink  > > wrote:
> >
> > > Just to drive home a point, let's play a game.
> > >
> > > First, guesstimate what percentage of our users have systems
> > with 2 or
> > > fewer cores.
> > >
> > > Then visit
> > https://hardware.metrics.mozilla.com/#goto-cpu-and-memory
> >  to
> > > check your guess.
> > >
> > > (I didn't say it was a *fun* game.)
> > >
> > >
> > > ___
> > > dev-platform mailing list
> > > dev-platform@lists.mozilla.org
> > 
> > > https://lists.mozilla.org/listinfo/dev-platform
> > 
> > >
> > ___
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org  dev-platform@lists.mozilla.org>
> > https://lists.mozilla.org/listinfo/dev-platform
> > 
> >
> >
>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: CPU core count game!

2018-04-05 Thread Bobby Holley
On Wed, Mar 28, 2018 at 12:03 PM, Steve Fink  wrote:

> Yes, sorry, a couple of people pointed that out to me privately. And I did
> get that mixed up; I was assuming processors, despite the page specifically
> pointing out "physical cores".
>
> I still think there's something to be kept in mind here, though. Even with
> 4 processors (2 hyperthreaded cores or whatever), it's never correct to
> assume that running something on a different thread is a gold bullet for
> performance problems. I'm all for increasing the concurrency of our code as
> long as we ensure that it doesn't hurt in the case of low levels of actual
> parallelism.
>

One additional consideration is that moving an expensive operation to a
background thread can reduce jank even if no concurrent execution occurs,
since thread preemption makes any operation effectively incremental. The
benefits here obviously need to be weighed against context switching and
contention costs.


> What that means in practice, I'm not entirely sure, but it does seem like
> we should be more conscious about thread priorities and global thread pool
> management. Also, lock contention is a real thing. It has been coming up
> here and there and wiping out parallelization gains.


Yeah, any work to add parallelism needs to be coupled with thorough
profiling and performance analysis. Assuming code is fast because it uses
threads is like assuming code is memory-safe because it compiles.


> On 3/28/18 10:27 AM, Ben Kelly wrote:
>
>> That page says "physical cores", so its not taking into account hyper
>> threading, right?  So even a high end macbook pro falls in that category?
>>
>> On Tue, Mar 27, 2018 at 5:02 PM, Mike Conley > > wrote:
>>
>> Thanks for drawing attention to this, sfink.
>>
>> This is likely to become more important as we continue to scale up our
>> parallelization with content processes and threads.
>>
>> On 21 March 2018 at 14:54, Steve Fink > > wrote:
>>
>> > Just to drive home a point, let's play a game.
>> >
>> > First, guesstimate what percentage of our users have systems
>> with 2 or
>> > fewer cores.
>> >
>> > Then visit
>> https://hardware.metrics.mozilla.com/#goto-cpu-and-memory
>>  to
>> > check your guess.
>> >
>> > (I didn't say it was a *fun* game.)
>> >
>> >
>> > ___
>> > dev-platform mailing list
>> > dev-platform@lists.mozilla.org
>> 
>> > https://lists.mozilla.org/listinfo/dev-platform
>> 
>> >
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org > >
>> https://lists.mozilla.org/listinfo/dev-platform
>> 
>>
>>
>>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: CPU core count game!

2018-04-05 Thread Dave Townsend
What is the point you're trying to drive home?

On Tue, Mar 27, 2018, 15:58 Steve Fink  wrote:

> Just to drive home a point, let's play a game.
>
> First, guesstimate what percentage of our users have systems with 2 or
> fewer cores.
>
> Then visit https://hardware.metrics.mozilla.com/#goto-cpu-and-memory to
> check your guess.
>
> (I didn't say it was a *fun* game.)
>
>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: CPU core count game!

2018-04-05 Thread Luke Wagner
fbertsch helpfully wrote a query that breaks down physical cores into the %
with and without HT enabled:
  https://sql.telemetry.mozilla.org/queries/47219/source
>From this we can see that, e.g., 6.7% of systems that report "2 logical
cores" (and ~2% of all systems) actually only have 1 physical core with 2
hyperthreads.  This seemed like the worst case for heuristics that solely
talk about logical threads (which, with only 1 exception that I can see
[1], seems like most of our heuristics).

That SQL query came out of a more general request to report logical and
physical info in the dashboard:
  https://github.com/mozilla/firefox-hardware-report/issues/60
If enough people are regularly interested in this data, it'd be good to
bump the priority of that issue.

Cheers,
Luke


[1]
https://searchfox.org/mozilla-central/source/gfx/layers/PaintThread.cpp#132


On Wed, Mar 28, 2018 at 2:03 PM, Steve Fink  wrote:

> Yes, sorry, a couple of people pointed that out to me privately. And I did
> get that mixed up; I was assuming processors, despite the page specifically
> pointing out "physical cores".
>
> I still think there's something to be kept in mind here, though. Even with
> 4 processors (2 hyperthreaded cores or whatever), it's never correct to
> assume that running something on a different thread is a gold bullet for
> performance problems. I'm all for increasing the concurrency of our code as
> long as we ensure that it doesn't hurt in the case of low levels of actual
> parallelism.
>
> What that means in practice, I'm not entirely sure, but it does seem like
> we should be more conscious about thread priorities and global thread pool
> management. Also, lock contention is a real thing. It has been coming up
> here and there and wiping out parallelization gains.
>
>
> On 3/28/18 10:27 AM, Ben Kelly wrote:
>
>> That page says "physical cores", so its not taking into account hyper
>> threading, right?  So even a high end macbook pro falls in that category?
>>
>> On Tue, Mar 27, 2018 at 5:02 PM, Mike Conley > > wrote:
>>
>> Thanks for drawing attention to this, sfink.
>>
>> This is likely to become more important as we continue to scale up our
>> parallelization with content processes and threads.
>>
>> On 21 March 2018 at 14:54, Steve Fink > > wrote:
>>
>> > Just to drive home a point, let's play a game.
>> >
>> > First, guesstimate what percentage of our users have systems
>> with 2 or
>> > fewer cores.
>> >
>> > Then visit
>> https://hardware.metrics.mozilla.com/#goto-cpu-and-memory
>>  to
>> > check your guess.
>> >
>> > (I didn't say it was a *fun* game.)
>> >
>> >
>> > ___
>> > dev-platform mailing list
>> > dev-platform@lists.mozilla.org
>> 
>> > https://lists.mozilla.org/listinfo/dev-platform
>> 
>> >
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org > >
>> https://lists.mozilla.org/listinfo/dev-platform
>> 
>>
>>
>>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: CPU core count game!

2018-03-31 Thread Steve Fink
Yes, sorry, a couple of people pointed that out to me privately. And I 
did get that mixed up; I was assuming processors, despite the page 
specifically pointing out "physical cores".


I still think there's something to be kept in mind here, though. Even 
with 4 processors (2 hyperthreaded cores or whatever), it's never 
correct to assume that running something on a different thread is a gold 
bullet for performance problems. I'm all for increasing the concurrency 
of our code as long as we ensure that it doesn't hurt in the case of low 
levels of actual parallelism.


What that means in practice, I'm not entirely sure, but it does seem 
like we should be more conscious about thread priorities and global 
thread pool management. Also, lock contention is a real thing. It has 
been coming up here and there and wiping out parallelization gains.



On 3/28/18 10:27 AM, Ben Kelly wrote:
That page says "physical cores", so its not taking into account hyper 
threading, right?  So even a high end macbook pro falls in that category?


On Tue, Mar 27, 2018 at 5:02 PM, Mike Conley > wrote:


Thanks for drawing attention to this, sfink.

This is likely to become more important as we continue to scale up our
parallelization with content processes and threads.

On 21 March 2018 at 14:54, Steve Fink > wrote:

> Just to drive home a point, let's play a game.
>
> First, guesstimate what percentage of our users have systems
with 2 or
> fewer cores.
>
> Then visit
https://hardware.metrics.mozilla.com/#goto-cpu-and-memory
 to
> check your guess.
>
> (I didn't say it was a *fun* game.)
>
>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org

> https://lists.mozilla.org/listinfo/dev-platform

>
___
dev-platform mailing list
dev-platform@lists.mozilla.org 
https://lists.mozilla.org/listinfo/dev-platform





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


Re: CPU core count game!

2018-03-31 Thread William Lachance
I don't believe these counts take into account the number of usage hours 
of each client, so people with 4+ cores may actually account for a 
larger amount of relative Firefox usage than their absolute numbers 
would suggest.


I am sure some people on the data / analyst / product side of Firefox 
have explored this issue (usage hours is reported on every ping), though 
I don't know if they monitor this list.


Will

On 2018-03-27 5:02 PM, Mike Conley wrote:

Thanks for drawing attention to this, sfink.

This is likely to become more important as we continue to scale up our
parallelization with content processes and threads.

On 21 March 2018 at 14:54, Steve Fink  wrote:


Just to drive home a point, let's play a game.

First, guesstimate what percentage of our users have systems with 2 or
fewer cores.

Then visit https://hardware.metrics.mozilla.com/#goto-cpu-and-memory to
check your guess.

(I didn't say it was a *fun* game.)

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


Re: CPU core count game!

2018-03-31 Thread Ben Kelly
That page says "physical cores", so its not taking into account hyper
threading, right?  So even a high end macbook pro falls in that category?

On Tue, Mar 27, 2018 at 5:02 PM, Mike Conley  wrote:

> Thanks for drawing attention to this, sfink.
>
> This is likely to become more important as we continue to scale up our
> parallelization with content processes and threads.
>
> On 21 March 2018 at 14:54, Steve Fink  wrote:
>
> > Just to drive home a point, let's play a game.
> >
> > First, guesstimate what percentage of our users have systems with 2 or
> > fewer cores.
> >
> > Then visit https://hardware.metrics.mozilla.com/#goto-cpu-and-memory to
> > check your guess.
> >
> > (I didn't say it was a *fun* game.)
> >
> >
> > ___
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
> >
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: CPU core count game!

2018-03-31 Thread Jeff Gilbert
Are these actual "physical cores", or is this "hardware threads"?
There's very big difference between 2 and 2+HT these days.

On Tue, Mar 27, 2018 at 2:02 PM, Mike Conley  wrote:
> Thanks for drawing attention to this, sfink.
>
> This is likely to become more important as we continue to scale up our
> parallelization with content processes and threads.
>
> On 21 March 2018 at 14:54, Steve Fink  wrote:
>
>> Just to drive home a point, let's play a game.
>>
>> First, guesstimate what percentage of our users have systems with 2 or
>> fewer cores.
>>
>> Then visit https://hardware.metrics.mozilla.com/#goto-cpu-and-memory to
>> check your guess.
>>
>> (I didn't say it was a *fun* game.)
>>
>>
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-platform
>>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: CPU core count game!

2018-03-31 Thread Joshua Cranmer 

On 3/27/2018 5:02 PM, Mike Conley wrote:

Thanks for drawing attention to this, sfink.

This is likely to become more important as we continue to scale up our
parallelization with content processes and threads.


How do these counts classify SMT systems (aka Hyperthreading)? Would 4 
core * 2-way SMT show up us 4 cores or 8 cores?


--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist

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


Re: CPU core count game!

2018-03-31 Thread David Durst
Just noting that there's bug 1399962 right now -- and if you're single core
(like a large portion of very affordable PCs in the past two years or so),
the problem can be so bad (bug 1431835) that common sites like amazon can
turn Firefox into a not viable option.

--
David Durst [:ddurst]

On Tue, Mar 27, 2018 at 5:02 PM, Mike Conley  wrote:

> Thanks for drawing attention to this, sfink.
>
> This is likely to become more important as we continue to scale up our
> parallelization with content processes and threads.
>
> On 21 March 2018 at 14:54, Steve Fink  wrote:
>
> > Just to drive home a point, let's play a game.
> >
> > First, guesstimate what percentage of our users have systems with 2 or
> > fewer cores.
> >
> > Then visit https://hardware.metrics.mozilla.com/#goto-cpu-and-memory to
> > check your guess.
> >
> > (I didn't say it was a *fun* game.)
> >
> >
> > ___
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
> >
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: CPU core count game!

2018-03-28 Thread Mike Conley
Thanks for drawing attention to this, sfink.

This is likely to become more important as we continue to scale up our
parallelization with content processes and threads.

On 21 March 2018 at 14:54, Steve Fink  wrote:

> Just to drive home a point, let's play a game.
>
> First, guesstimate what percentage of our users have systems with 2 or
> fewer cores.
>
> Then visit https://hardware.metrics.mozilla.com/#goto-cpu-and-memory to
> check your guess.
>
> (I didn't say it was a *fun* game.)
>
>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


CPU core count game!

2018-03-27 Thread Steve Fink

Just to drive home a point, let's play a game.

First, guesstimate what percentage of our users have systems with 2 or 
fewer cores.


Then visit https://hardware.metrics.mozilla.com/#goto-cpu-and-memory to 
check your guess.


(I didn't say it was a *fun* game.)


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