depth

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMinChunk = 256

DefaultMinChunk is the fewest elements an operation will hand to a single goroutine. Below it, the cost of starting a goroutine and collecting its result outweighs the work, and fanning out further makes an operation slower rather than faster.

View Source
const (
	// Fanout determines the number of children each branch will have.
	Fanout = 1 << FanoutBits
)
View Source
const FanoutBits = 3

Variables

This section is empty.

Functions

func MinChunk added in v1.14.0

func MinChunk() int

MinChunk returns the current minimum chunk size, or 0 if parallelism is disabled.

func SetMinChunk added in v1.14.0

func SetMinChunk(n int) int

SetMinChunk sets the minimum chunk size and returns the previous one. A value below 1 disables parallelism.

Types

type Gauge

type Gauge int
var (

	// NonParallel is a Gauge that never triggers parallel behaviour.
	NonParallel Gauge = -1
)

func NewGauge

func NewGauge(count int) Gauge

func (Gauge) Parallel

func (pd Gauge) Parallel(depth int, mask masker.Masker, f func(i int) (bool, int)) (_ bool, matches int)

Jump to

Keyboard shortcuts

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