On Wed, Mar 28, 2018 at 12:03 PM, Steve Fink <sf...@mozilla.com> 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 <mcon...@mozilla.com
>> <mailto:mcon...@mozilla.com>> 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 <sf...@mozilla.com
>>     <mailto:sf...@mozilla.com>> 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
>>     <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
>>     <mailto:dev-platform@lists.mozilla.org>
>>     > https://lists.mozilla.org/listinfo/dev-platform
>>     <https://lists.mozilla.org/listinfo/dev-platform>
>>     >
>>     _______________________________________________
>>     dev-platform mailing list
>>     dev-platform@lists.mozilla.org <mailto:dev-platform@lists.mozilla.org
>> >
>>     https://lists.mozilla.org/listinfo/dev-platform
>>     <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

Reply via email to