Il 11/03/20 15:23, Jesper Louis Andersen ha scritto:
On Wed, Mar 11, 2020 at 1:43 PM Nicola Murino <nicola.mur...@gmail.com <mailto:nicola.mur...@gmail.com>> wrote:

    So I wrote a proof of concept allocator that tries to avoid all
    these extra allocations reusing the previously allocated slices:

    https://github.com/drakkan/sftp/blob/master/allocator.go


Any particular reason you avoided something like sync.Pool ? It could be useful in your case, allocation pattern depending.

Hi,

I initially evaluated the sync.Pool then I read this article:

https://dzone.com/articles/memory-pooling-in-go-where-why-and-how

and this issue:

https://github.com/golang/go/issues/23199

so I decided to avoid the sync.Pool,

anyway I'm currently reviewing the allocator to submit a pull request against pkg/sftp, I'll probably do a quick test with the "sync.Pool" too and I'll take a look at the memory profiling results,

Nicola

--
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/239b0930-ada2-aedb-b08b-27925eefc423%40gmail.com.

Reply via email to