Yes, there is only pointers in sync.Pool.

I think the sync.Pool only slow during GCing is a normal behavior. If the 
sync.Pool's method slow with out GCing is a runtime issue.

I donot agree:

sync.Pool just amortizes the cost of creating garbage


The sync.Pool is reusing object and reducing creating garbage during each 
gc.

在 2018年8月13日星期一 UTC+8下午1:59:02,Tamás Gulácsi写道:
>
> sync.Pool just amortizes the cost of creating garbage, does not eliminiate 
> it...
> You have to pay for your garbage somewhere!
>
> Are you sure you put only pointers into yout Pool?
>
> 2018. augusztus 13., hétfő 6:57:48 UTC+2 időpontban [email protected] a 
> következőt írta:
>>
>> Hi,
>>
>> My services show some latency spikes > 100ms sometimes. Then I use go 
>> trace to investigate this issue. And I found that sync.(*Pool).Put maybe 
>> cause the latency spikes.
>>
>> Is there someone encounter this issue also?
>> Is it a runtime issue?
>>
>> [image: sync-pool.png]
>>
>>
>>
>>
>> go version: go version go1.10 darwin/amd64 compile to linux amd64
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to