MCPcopy
hub / github.com/klauspost/compress / WithConcurrentBlocks

Function WithConcurrentBlocks

zstd/encoder_options.go:345–353  ·  view source on GitHub ↗

WithConcurrentBlocks enables job-based parallel compression for streams. When enabled and concurrent > 1, input is split into large sections (jobs) that are compressed simultaneously by multiple goroutines. Each non-first job receives an overlap prefix from the previous job for match context. Output

(b bool)

Source from the content-addressed store, hash-verified

343// Currently disabled when used with dictionary encoding.
344// Cannot be changed with ResetWithOptions.
345func WithConcurrentBlocks(b bool) EOption {
346 return func(o *encoderOptions) error {
347 if o.resetOpt && b != o.concurrentBlocks {
348 return errors.New("WithConcurrentBlocks cannot be changed on Reset")
349 }
350 o.concurrentBlocks = b
351 return nil
352 }
353}
354
355// jobSize returns the input section size per parallel job.
356func (o *encoderOptions) jobSize() int {

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…