-
Notifications
You must be signed in to change notification settings - Fork 48
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
Make the cube root to be inlined #489
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #489 +/- ##
==========================================
+ Coverage 93.12% 93.35% +0.22%
==========================================
Files 9 9
Lines 1018 1053 +35
==========================================
+ Hits 948 983 +35
Misses 70 70
Continue to review full report at Codecov.
|
using Colors, BenchmarkTools
rgb_f64 = rand(RGB{Float64}, 1000, 1000);
xyz_f64 = XYZ{Float64}.(rgb_f64);
xyz_f32 = XYZ{Float32}.(xyz_f64);
lab_f64 = Lab{Float64}.(xyz_f64);
lab_f32 = Lab{Float32}.(lab_f64); julia> @btime convert.(Lab, $xyz_f64);
121.341 ms (5965520 allocations: 113.91 MiB) # before
29.326 ms (2 allocations: 22.89 MiB) # before (recompiled)
24.800 ms (2 allocations: 22.89 MiB) # after
julia> @btime convert.(Lab, $xyz_f32);
129.864 ms (5965520 allocations: 102.47 MiB) # before
23.362 ms (2 allocations: 11.44 MiB) # before (recompiled)
23.656 ms (2 allocations: 11.44 MiB) # after I'm still not sure what's going on. 😕 |
59eff82
to
63ed178
Compare
This makes the cube root to be inlined to make it suitable for vectorization. This is intended to reduce precompilation problems rather than increase the speed.
kimikage
added a commit
to kimikage/Colors.jl
that referenced
this pull request
May 11, 2024
This makes the cube root to be inlined to make it suitable for vectorization. This is intended to reduce precompilation problems rather than increase the speed.
kimikage
added a commit
that referenced
this pull request
May 11, 2024
This makes the cube root to be inlined to make it suitable for vectorization. This is intended to reduce precompilation problems rather than increase the speed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes the cube root to be inlined to make it suitable for vectorization.
This is intended to reduce precompilation problems rather than increase the speed. (cf. #425)
This also optimizes theEdit: I will separate this into a new PR. (Edit2: see PR #493)pow5_12(::Float32)
.