I was doing some tuning on an I/O intensive application, and found that I
could cut my memory footprint dramatically in places by replacing my
bytes.Buffer usage with fixed-sized circular ring buffers. Its a small
project, but I suspect the library might be useful to others. Hence this
brief announcement. I call the library rbuf:


The rbuf library is byte-oriented, but could be readily adapted to any
other type you want to store in a ring. It implements a bunch of standard
interface methods (e.g. ReadFrom(), WriteTo()) to let io.Copy() avoid extra
allocations, and offers additional performance-oriented methods like
ReadWithoutAdvance(), Adopt(), Advance(), a Readable member, and so forth.
Together these yielded a much smaller memory footprint in my app, going
from a 8GB working set to just 25MB.


- Jason

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
postedApr 7, '14 at 2:25p
activeApr 7, '14 at 2:25p

1 user in discussion

Jason E. Aten: 1 post



site design / logo © 2021 Grokbase