-
Notifications
You must be signed in to change notification settings - Fork 47
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
Improve speed and mean accuracy of pow12_5
#483
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 #483 +/- ##
==========================================
+ Coverage 92.41% 92.79% +0.38%
==========================================
Files 9 9
Lines 975 985 +10
==========================================
+ Hits 901 914 +13
+ Misses 74 71 -3
Continue to review full report at Codecov.
|
efca927
to
e6f024c
Compare
Benchmarkjulia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
julia> xs = rand(1000) .+ 0.09;
julia> @noinline f(x) = Colors.pow12_5(x);
julia> @btime f.($xs);
17.200 μs (1 allocation: 7.94 KiB) # before
8.500 μs (1 allocation: 7.94 KiB) # after |
6cb55de
to
e3b30df
Compare
pow12_5
pow12_5
`pow12_5` is used in the `RGB{Float64}`-->`XYZ` conversion. This ensures sufficient accuracy (~2 ULP) in the range of [0.09, 1], which is typically required for the conversion. `@inline` could be a workaround for the problem with precompilation.
kimikage
added a commit
to kimikage/Colors.jl
that referenced
this pull request
May 11, 2024
`pow12_5` is used in the `RGB{Float64}`-->`XYZ` conversion. This ensures sufficient accuracy (~2 ULP) in the range of [0.09, 1], which is typically required for the conversion. `@inline` could be a workaround for the problem with precompilation.
kimikage
added a commit
that referenced
this pull request
May 11, 2024
`pow12_5` is used in the `RGB{Float64}`-->`XYZ` conversion. This ensures sufficient accuracy (~2 ULP) in the range of [0.09, 1], which is typically required for the conversion. `@inline` could be a workaround for the problem with precompilation.
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.
pow12_5
is used in theRGB{Float64}
-->XYZ
conversion.This ensures sufficient accuracy (~2 ULP) in the range of [0.09, 1], which is typically required for the conversion.
I decided to solve #425 first in order to do a fair benchmark for PR #482. However, it doesn't seem to be solved by just not using
exp
. 😕If we can accept the divergence when the input is more than 2.0, thenwe can merge this. However, I would like to study #425 some more.Edit:
@inline
is not a good idea, but it could be a workaround for the problem with precompilation.