[go-nuts] embed.FS and memory limitations

2021-02-16 Thread Carlo Alberto Ferraris
Was going through the implementation of embed.FS and started wondering about the lack of WriteTo - specifically about the implications in case the embedded data is not present in memory e.g. because it got evicted due to memory pressure - or simply due to outright not fitting in memory. Won’t t

[go-nuts] Re: Tweaking sync.Pool for mostly-empty pools

2018-02-16 Thread Carlo Alberto Ferraris
at all. Can you compare the internal workload with an implementation > where all callers just call the `New` function directly? What's the purpose > of using a pooled memory if there's often nothing in the pool? > > On Wednesday, February 14, 2018 at 3:56:34 PM UTC-8, Carlo

[go-nuts] Re: Tweaking sync.Pool for mostly-empty pools

2018-02-16 Thread Carlo Alberto Ferraris
call the `New` function directly? What's the purpose > of using a pooled memory if there's often nothing in the pool? > > On Wednesday, February 14, 2018 at 3:56:34 PM UTC-8, Carlo Alberto > Ferraris wrote: >> >> In an attempt to reduce the time pprof says is spe

[go-nuts] Tweaking sync.Pool for mostly-empty pools

2018-02-14 Thread Carlo Alberto Ferraris
In an attempt to reduce the time pprof says is spent in sync.Pool (internal workloads, sorry) I modified Get and getSlow to skip locking the per-P shared pools if the pools are likely to be empty. This yields promising results, but I'm not sure the approach is sound since the check I do is inhe