Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multithreading is not used for IDCT if the rayon feature is enabled #245

Open
Shnatsel opened this issue May 13, 2022 · 0 comments
Open

Comments

@Shnatsel
Copy link
Contributor

hyperfine shows the image decoding being significantly faster with the rayon feature disabled:

Benchmark 1: jpeg-bench/target/release/jpeg-bench "some-large-jpeg.jpg"
  Time (mean ± σ):     705.5 ms ±  22.7 ms    [User: 830.4 ms, System: 151.0 ms]
  Range (min … max):   680.5 ms … 742.2 ms    10 runs
 
Benchmark 2: jpeg-bench-parallel/target/release/jpeg-bench-parallel "some-large-jpeg.jpg"
  Time (mean ± σ):     867.2 ms ±  11.1 ms    [User: 906.7 ms, System: 120.5 ms]
  Range (min … max):   854.6 ms … 888.7 ms    10 runs
 
Summary
  'jpeg-bench/target/release/jpeg-bench "some-large-jpeg.jpg"' ran
    1.23 ± 0.04 times faster than 'jpeg-bench-parallel/target/release/jpeg-bench-parallel "some-large-jpeg.jpg"'

Looking at the profile, it seems that the additional threads for IDCT are spawned only when the rayon feature is disabled (profile). When it is enabled, the IDCT is happening on the main thread (profile).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant