Package Usage: go: github.com/philhofer/fwd
Package fwd provides a buffered reader
and writer. Each has methods that help improve
the encoding/decoding performance of some binary
protocols.
The Writer and Reader type provide similar
functionality to their counterparts in bufio, plus
a few extra utility methods that simplify read-ahead
and write-ahead. I wrote this package to improve serialization
performance for http://github.com/tinylib/msgp,
where it provided about a 2x speedup over `bufio` for certain
workloads. However, care must be taken to understand the semantics of the
extra methods provided by this package, as they allow
the user to access and manipulate the buffer memory
directly.
The extra methods for Reader are Reader.Peek, Reader.Skip
and Reader.Next. (*fwd.Reader).Peek, unlike (*bufio.Reader).Peek,
will re-allocate the read buffer in order to accommodate arbitrarily
large read-ahead. (*fwd.Reader).Skip skips the next 'n' bytes
in the stream, and uses the io.Seeker interface if the underlying
stream implements it. (*fwd.Reader).Next returns a slice pointing
to the next 'n' bytes in the read buffer (like Reader.Peek), but also
increments the read position. This allows users to process streams
in arbitrary block sizes without having to manage appropriately-sized
slices. Additionally, obviating the need to copy the data from the
buffer to another location in memory can improve performance dramatically
in CPU-bound applications.
Writer only has one extra method, which is (*fwd.Writer).Next, which
returns a slice pointing to the next 'n' bytes of the writer, and increments
the write position by the length of the returned slice. This allows users
to write directly to the end of the buffer.
4 versions
Latest release: plus de 2 ans ago
3 426 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/philhofer/fwd
Dependent Repos 3
cea-hpc/fabricmon Fork of dswarbrick/fabricmon
InfiniBand fabric monitoring daemon written in GoSize: 404 ko - Last synced: environ 15 heures ago - Pushed: 6 mois ago

InseeFrLab/onyxia-onboarding-operator
An operator for onyxia's onboarding tasksSize: 71,3 ko - Last synced: 7 jours ago - Pushed: plus d'un an ago

InseeFrLab/s3-operator
A simple operator to dynamically create S3 buckets and policiesSize: 331 ko - Last synced: 7 jours ago - Pushed: 8 jours ago
