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

Avoid extra buffer indirection during decoding #30

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

jkrumbiegel
Copy link
Collaborator

I noticed that the profiler recorded a lot of time in the copyto! code, so I tried refactoring that. To me it seems to be equivalent behavior, let's see what CI says. The memory gain is actually not much, but the time gained is about half.

# before
@time JpegTurbo.jpeg_decode("some_25MP.jpg")
0.860027 seconds (32 allocations: 169.126 MiB, 0.46% gc time)

# after
0.419224 seconds (30 allocations: 169.108 MiB, 1.75% gc time)

@codecov
Copy link

codecov bot commented Sep 24, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.19% ⚠️

Comparison is base (d3e4d8e) 81.68% compared to head (b1bd80f) 81.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
- Coverage   81.68%   81.50%   -0.19%     
==========================================
  Files           6        6              
  Lines         202      200       -2     
==========================================
- Hits          165      163       -2     
  Misses         37       37              
Files Changed Coverage Δ
src/decode.jl 87.85% <100.00%> (-0.23%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johnnychen94
Copy link
Member

Thanks for fixing this! I knew there's room for improvement here but I failed to figure out how.

@johnnychen94 johnnychen94 merged commit dfa1186 into JuliaIO:master Sep 25, 2023
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

Successfully merging this pull request may close these issues.

2 participants