github.com/philhofer/fwd
go
pkg:golang/github.com/philhofer/fwd
8 Dependabot PRs
7 months ago
3 repositories
1 repository
Recent PRs
chore(deps): bump github.com/philhofer/fwd from 1.1.3-0.20240916144458-20a13a1f6b7c to 1.2.0 in /svelte-netlify
gofiber/recipes #3788
chore(deps): bump github.com/philhofer/fwd from 1.1.3-0.20240916144458-20a13a1f6b7c to 1.2.0 in /csrf-with-session
gofiber/recipes #3760
chore(deps): bump github.com/philhofer/fwd from 1.1.3-0.20240916144458-20a13a1f6b7c to 1.2.0 in /csrf
gofiber/recipes #3759
chore(deps): bump the minor-updates group across 1 directory with 43 updates
chore(deps): bump the minor-updates group across 1 directory with 44 updates
chore(deps): bump the minor-updates group across 1 directory with 43 updates
chore(deps): bump the minor-updates group across 1 directory with 33 updates
chore(deps): bump github.com/philhofer/fwd from 1.1.3-0.20240916144458-20a13a1f6b7c to 1.2.0
golanglib/dependabot_botherer #3533
Package Details
| Name: | github.com/philhofer/fwd |
| Ecosystem: | go |
| PURL Type: | golang |
| Package URL: | pkg:golang/github.com/philhofer/fwd |
| JSON API: | View JSON |
Package Information
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.
| Repository: | https://github.com/philhofer/fwd |
| Homepage: | https://github.com/philhofer/fwd |
| Latest Release: |
v1.2.0
over 1 year ago |
| Dependent Repos: | 12,369 |
| Dependent Packages: | 3,426 |
| Ranking: | Top 0.0664% by dependent repos Top 0.0619% by dependent pkgs |