Many thank for the perf tool, it is pretty awesome.
> On 27. Aug 2019, at 13:36, Robert Engels wrote:
>
> Ok maybe it wasn’t the cache issue, so then try this, below a certain number
> of go routines given the workload the spin and cas works, beyond a certain
> point it is forced into the
>>
>> Still, you keep ignoring this aspect - in the context of actual workloads
>> the difference is negligible.
>> -Original Message-
>> From: changkun
>> Sent: Aug 26, 2019 4:08 PM
>> To: golang-nuts
>> Subject: Re: [go-nuts] sync.Mutex encou
hint/(hint+miss)
>>> 2400 697103572 17641686 0.9753175194
>>> 3200 798160789 54169784 0.9364451004
>>> 3360 1387972473 148415678 0.9033996208
>>> 3600 1824541062 272166355 0.8701934506
>>> 4000 2053779401 393586501 0.8391795437
>>> 4800 1885
ds
> the difference is negligible.
>
> -Original Message-
> From: changkun
> Sent: Aug 26, 2019 4:08 PM
> To: golang-nuts
> Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when
> goroutine contention more than 3400
>
> Based on the pprof graph, I w
is negligible.-Original Message-
From: changkun
Sent: Aug 26, 2019 4:08 PM
To: golang-nuts
Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400
Based on the pprof graph, I would rather believe that the massive performance drop happens
>> configuration dependent - so I think I've probably reached the end of being
>> able to help.
>>
>> And finally, it probably doesn't matter at all - if the Go routine is
>> doing anything of value, 300 ns is probably an insignificant cost.
>>
>>
>>
-
From: changkun
Sent: Aug 26, 2019 2:23 PM
To: golang-nuts
Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400
Your cache theory is very reasonable, but this was clear in the beginning post: "before or after the massive increase, perfor
onitor the cpu cache hit/miss
> ratio.
>
> -Original Message-
> From: changkun
> Sent: Aug 26, 2019 2:23 PM
> To: golang-nuts
> Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when
> goroutine contention more than 3400
>
>
'more work' yet constant that destroys the cache - and back into the concurrency times.-Original Message-
From: changkun
Sent: Aug 26, 2019 2:23 PM
To: golang-nuts
Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400
Your cache theory
You can run the process under 'perf' and monitor the cpu cache hit/miss ratio.-Original Message-
From: changkun
Sent: Aug 26, 2019 2:23 PM
To: golang-nuts
Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400
Your cache theory
slower than 3600 - so it is
> increasing linearly with the number of Go routines.
>
>
> -Original Message-
> From: changkun
> Sent: Aug 26, 2019 11:49 AM
> To: golang-nuts
> Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when
> goroutine
: changkun
Sent: Aug 26, 2019 11:49 AM
To: golang-nuts
Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400
According to your formula let's sample three points:2400 goroutines: 2.508s/(5000*2400) = 2.09 × 10^-11 s3600 goroutines: 12.219s
According to your formula let's sample three points:
2400 goroutines: 2.508s/(5000*2400) = 2.09 × 10^-11 s
3600 goroutines: 12.219s/(5000*3600) = 6.7883 × 10-11 seconds
4800 goroutines: 16.020s/(5000*4800) = 6.67500 × 10^-11 s
One can observe that 3600 and 4800 mostly equal to
And it looks like the `semacquire1` executed too many `gopark`, which means
indicating that `cansemacquire` failed a lot when too much contention
happens.
On Monday, August 26, 2019 at 6:27:14 PM UTC+2, changkun wrote:
>
> Sorry for late response. Do you mean the total execution was not the
che is exhausted - the kernel based scheduler
> is more efficient - so it does suggest to me that there are some
> optimizations that can be done in the Go scheduler.
>
> I will look at a few things this evening.
>
> -Original Message-----
> From: changkun
> Sent: Aug 21, 20
using L1 evictions anyway - so you never see
> the optimum performance possible of the scheduler).
>
> -Original Message-
> From: changkun
> Sent: Aug 20, 2019 3:33 AM
> To: golang-nuts
> Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when
> gor
, 2019 4:51 PM
To: golang-nuts
Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400
"less than N Go routines it fits in the L1 CPU cache," I am guessing that you are thinking of local queues on each M, the scheduler's local queue size
;> chan/futex version is unfair - meaning many are starved.
>>
>> -Original Message-
>> From: changkun
>> Sent: Aug 19, 2019 12:50 PM
>> To: golang-nuts
>> Subject: [go-nuts] sync.Mutex encounter large performance drop when
>> goroutine c
: changkun
Sent: Aug 20, 2019 3:33 AM
To: golang-nuts
Subject: Re: [go-nuts] sync.Mutex encounter large performance drop when goroutine contention more than 3400
Hi Robert,Thanks for your explanation. But how could I "logged the number of operations done per Go routine", which partic
many are starved.
>
> -Original Message-
> From: changkun
> Sent: Aug 19, 2019 12:50 PM
> To: golang-nuts
> Subject: [go-nuts] sync.Mutex encounter large performance drop when goroutine
> contention more than 3400
>
> I am comparing the performance regardi
Hi Ian Davis, I read the issue before I post this thread.
I think the old issue is quite different than here. Here the problem
discusses sudden performance drop and unexpected regression,
but the issue#5183 only did experiment on a very limited number of
goroutines, and Dmitry's answer is fair
On Tue, 20 Aug 2019, at 9:33 AM, changkun wrote:
> Hi Robert,
>
> Thanks for your explanation. But how could I "logged the number of operations
> done per Go routine", which particular debug settings you referring to?
> It is reasonable that sync.Mutex rely on runtime scheduler but channels do
, you will see that the Mutex version is very fair, and the
> chan/futex version is unfair - meaning many are starved.
>
> -Original Message-
> From: changkun
> Sent: Aug 19, 2019 12:50 PM
> To: golang-nuts
> Subject: [go-nuts] sync.Mutex encounter large performan
] sync.Mutex encounter large performance drop when goroutine contention more than 3400
I am comparing the performance regarding sync.Mutex and Go channels. Here is my benchmark: https://play.golang.org/p/zLjVtsSx9gdThe performance comparison visualization is as follows:What are the reasons that 1
I am comparing the performance regarding sync.Mutex and Go channels. Here
is my benchmark: https://play.golang.org/p/zLjVtsSx9gd
The performance comparison visualization is as follows:
[image: sync.Mutex performance (1).png]
What are the reasons that
1. sync.Mutex encounter a large
25 matches
Mail list logo