mirror of
https://github.com/junegunn/fzf.git
synced 2026-03-02 05:17:07 +08:00
Add --threads option to control matcher concurrency
By default, fzf uses 8 * NumCPU goroutines (capped at 32) for parallel matching. --threads N overrides this to use exactly N goroutines, which is useful for benchmarking and profiling.
This commit is contained in:
@@ -235,7 +235,7 @@ func Run(opts *Options) (int, error) {
|
||||
opts.Fuzzy, opts.FuzzyAlgo, opts.Extended, opts.Case, opts.Normalize, forward, withPos,
|
||||
opts.Filter == nil, nth, opts.Delimiter, inputRevision, runes, denylistCopy, headerLines)
|
||||
}
|
||||
matcher := NewMatcher(cache, patternBuilder, sort, opts.Tac, eventBox, inputRevision)
|
||||
matcher := NewMatcher(cache, patternBuilder, sort, opts.Tac, eventBox, inputRevision, opts.Threads)
|
||||
|
||||
// Filtering mode
|
||||
if opts.Filter != nil {
|
||||
|
||||
Reference in New Issue
Block a user