Skip to content

Commit 49139b7

Browse files
197gShnatsel
andcommitted
Adjust constants for preferred worker
Co-Authored-By: Shnatsel <Shnatsel@users.noreply.github.com>
1 parent cfa7b49 commit 49139b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/decoder.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,14 @@ impl<R: Read> Decoder<R> {
199199
/// Heuristic to avoid starting thread, synchronization if we expect a small amount of
200200
/// parallelism to be utilized.
201201
fn select_worker(frame: &FrameInfo, worker_preference: PreferWorkerKind) -> PreferWorkerKind {
202-
// TODO: figure out the exact value.
203-
const PARALLELISM_THRESHOLD: u64 = 1024 * 1024;
202+
const PARALLELISM_THRESHOLD: u64 = 128 * 128;
204203

205204
match worker_preference {
206205
PreferWorkerKind::Immediate => PreferWorkerKind::Immediate,
207206
PreferWorkerKind::Multithreaded => {
208207
let width: u64 = frame.output_size.width.into();
209208
let height: u64 = frame.output_size.width.into();
210-
if width * height * frame.components.len() as u64 > PARALLELISM_THRESHOLD {
209+
if width * height > PARALLELISM_THRESHOLD {
211210
PreferWorkerKind::Multithreaded
212211
} else {
213212
PreferWorkerKind::Immediate

0 commit comments

Comments
 (0)