From 8ecd1dc4a60e063251963305b98888236b8d9825 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 30 Jan 2024 14:00:03 -0500 Subject: bftw: Optimize -s -j2 searches Maintaining balance and strict ordering at the same time forces too much work onto the main thread. --- src/bftw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/bftw.c') diff --git a/src/bftw.c b/src/bftw.c index 400307b..ab930f1 100644 --- a/src/bftw.c +++ b/src/bftw.c @@ -802,8 +802,7 @@ static int bftw_state_init(struct bftw_state *state, const struct bftw_args *arg } if (state->flags & BFTW_SORT) { qflags |= BFTW_QORDER; - } - if (nthreads == 1) { + } else if (nthreads == 1) { qflags |= BFTW_QBALANCE; } bftw_queue_init(&state->fileq, qflags); -- cgit v1.2.3