4 ms·
I do not know Go. But what if there are so many high level abstractions in the Go language that it operates on streams directly?
by jesprenj 4y ago
I do not know Go. But what if there are so many high level abstractions in the Go language that it operates on streams directly?
- yencabulator 4y agoThe standard convention is to slap bufio.Reader/bufio.Writer on streams to make them more performant. Though how LFS ends up with ~50 byte chunks is probably something very, very, dumb in the LFS code itself. Better to fix that mistake than to paper over it.
- morelisp 4y agobufio is for adding buffering regardless of source/dest. Better in this case is ReaderFrom (which will also be used transparently by io.Copy) to let the socket control the buffering and apply even more optimizations. For something like git-lfs I could expect sendfile to provide a huge improvement, depending on the underlying storage.