Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IOLimit ¶
IOLimit returns a concurrency cap for I/O-bound file operations. SSD-backed filesystems benefit from more outstanding requests than there are CPU cores.
func ParallelFor ¶ added in v1.0.0
func ParallelFor[T any](items []T, parallel bool, workerCount int, fn func(i int, item T) error) error
ParallelFor runs fn over every item, fanning out to workers when the work justifies it (per ShouldParallelize) and running serially otherwise. The serial path stops at the first error; the parallel path waits for started goroutines and returns the first error. workerCount caps parallel fan-out; when it is <= 0 the cap defaults to Limit(len(items)).
func ShouldParallelize ¶
ShouldParallelize reports whether a build phase has enough work to benefit from worker fan-out. Small phases stay serial to avoid goroutine overhead.
Types ¶
This section is empty.