pool

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeSlicePool = sync.Pool{
	New: func() interface{} {

		return make([]*goquery.Selection, 0, 100)
	},
}

NodeSlicePool provides pooled slices for goquery selections This helps reduce memory allocations during DOM traversal

View Source
var StringBuilderPool = sync.Pool{
	New: func() interface{} {
		return &strings.Builder{}
	},
}

StringBuilderPool provides pooled string builders This helps reduce memory allocations during string concatenation

View Source
var StringSlicePool = sync.Pool{
	New: func() interface{} {
		return make([]string, 0, 50)
	},
}

StringSlicePool provides pooled string slices This helps reduce memory allocations during string processing

Functions

func GetNodeSlice

func GetNodeSlice() []*goquery.Selection

GetNodeSlice gets a node slice from the pool

func GetStringBuilder

func GetStringBuilder() *strings.Builder

GetStringBuilder gets a string builder from the pool

func GetStringSlice

func GetStringSlice() []string

GetStringSlice gets a string slice from the pool

func PutNodeSlice

func PutNodeSlice(slice []*goquery.Selection)

PutNodeSlice returns a node slice to the pool

func PutStringBuilder

func PutStringBuilder(sb *strings.Builder)

PutStringBuilder returns a string builder to the pool

func PutStringSlice

func PutStringSlice(slice []string)

PutStringSlice returns a string slice to the pool

Types

This section is empty.

Jump to

Keyboard shortcuts

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