Documentation
¶
Overview ¶
Package bufpool provides buffer pools for reducing GC pressure in hot paths. This is the WASM version which uses simple allocations since sync.Pool behavior differs in WASM environments.
Index ¶
Constants ¶
View Source
const ( // SmallBufferSize for index keys (8-64 bytes typical) SmallBufferSize = 64 // MediumBufferSize for event encoding (300-1000 bytes typical) MediumBufferSize = 1024 )
Variables ¶
This section is empty.
Functions ¶
func CopyBytes ¶
CopyBytes copies the buffer contents to a new slice.
func GetSmall ¶
GetSmall returns a small buffer (64 bytes). In WASM, we simply allocate new buffers as sync.Pool is less effective.
func PutMedium ¶
PutMedium is a no-op in WASM; the buffer will be garbage collected.
Types ¶
This section is empty.
Source Files
¶
- pool_wasm.go
Click to show internal directories.
Click to hide internal directories.