⭐ the project to show your appreciation.
This package is a thin wrapper over the Pool
provided by the sync
package. The Pool
is an essential package to obtain maximum performance. It does so by reducing memory allocations.
- Invalidate an item from the Pool (so it never gets used again)
- Set a maximum number of items for the Pool (Limit pool growth)
- Return the number of items in the pool (idle and in-use)
- Designed for concurrency
- Fully Generic
If you frequently allocate many objects of the same type and you want to save some memory allocation and garbage allocation overhead — @jrv
Read How did I improve latency by 700% using sync.Pool
import "github.com/rocketlaunchr/go-pool"
type X struct {}
pool := pool.New(func() *X {
return &X{}
}, 5) // maximum of 5 items can be borrowed at a time
borrowed := pool.Borrow()
defer borrowed.Return()
// Use item here or mark as invalid
x := borrowed.Item() // Use Item of type: *X
borrowed.MarkAsInvalid()
- awesome-svelte - Resources for killing react
- dataframe-go - Statistics and data manipulation
- dbq - Zero boilerplate database operations for Go
- electron-alert - SweetAlert2 for Electron Applications
- google-search - Scrape google search results
- igo - A Go transpiler with cool new syntax such as fordefer (defer for for-loops)
- mysql-go - Properly cancel slow MySQL queries
- react - Build front end applications using Go
- remember-go - Cache slow database queries
- testing-go - Testing framework for unit testing
- Renee French (gopher)
- Samuel Jirénius (illustration)