bufpool

package
v0.8.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package bufpool keeps the buffers the server fills and empties all day, so each answer borrows one instead of asking for new memory that the garbage collector then has to find and free. On a small machine that work is a real share of what a request costs.

Index

Constants

This section is empty.

Variables

View Source
var Copy copyPool

Copy lends buffers for copying a stream from one place to another. It is an httputil.BufferPool, for the proxy to a module's service.

Functions

func Get

func Get() *bytes.Buffer

Get borrows an empty buffer. Give it back with Put when nothing holds its bytes.

func Put

func Put(b *bytes.Buffer)

Put gives a buffer back. Nothing may use the buffer, or bytes taken from it, after.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL