Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce Memory Usage by Optimizing Order of Fields #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bytebuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import "io"
//
// Use Get for obtaining an empty byte buffer.
type ByteBuffer struct {

// B is a byte buffer to use in append-like workloads.
// See example code for details.
B []byte
Expand Down
3 changes: 1 addition & 2 deletions pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ const (
// Properly determined byte buffer types with their own pools may help reducing
// memory waste.
type Pool struct {
pool sync.Pool
calls [steps]uint64
calibrating uint64

defaultSize uint64
maxSize uint64

pool sync.Pool
}

var defaultPool Pool
Expand Down