objectpool

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 3 Imported by: 0

README

objectpool

Generic Object Pool,thread safe

goos: windows
goarch: amd64
pkg: github.com/FJSDS/objectpool
cpu: AMD Ryzen 5 5600 6-Core Processor              
BenchmarkGetPut
BenchmarkGetPut-12              	73732718	        14.90 ns/op	       0 B/op	       0 allocs/op
BenchmarkGetSlicePutSlice
BenchmarkGetSlicePutSlice-12    	80940528	        15.18 ns/op	       0 B/op	       0 allocs/op
BenchmarkGetMapPutMap
BenchmarkGetMapPutMap-12        	74947536	        16.18 ns/op	       0 B/op	       0 allocs/op
BenchmarkPool
BenchmarkPool-12                	100000000	        10.03 ns/op	       0 B/op	       0 allocs/op
PASS

Process finished with the exit code 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[T any]() *T

func GetMap

func GetMap[K comparable, V any]() map[K]V

func Put

func Put[T any](t *T)

func PutMap

func PutMap[K comparable, V any](t map[K]V)

func PutSlice

func PutSlice[T any](t *Slice[T])

Types

type Slice

type Slice[T any] struct {
	Data []T
}

func GetSlice

func GetSlice[T any]() *Slice[T]

Jump to

Keyboard shortcuts

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