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

Use sin/cos instead of sind/cosd in DE_2000 calculation #498

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

kimikage
Copy link
Collaborator

This is one of the preparations for PR #494.
sind/cosd was one of the speed bottlenecks in the DE_2000 calculation. The degradation in accuracy due to this change is negligible. (For _de2000_t, it is rather an improvement.)

@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

Merging #498 (a5aca15) into master (9d69f98) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #498      +/-   ##
==========================================
+ Coverage   93.61%   93.64%   +0.02%     
==========================================
  Files           9        9              
  Lines        1097     1101       +4     
==========================================
+ Hits         1027     1031       +4     
  Misses         70       70              
Impacted Files Coverage Δ
src/differences.jl 99.05% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d69f98...a5aca15. Read the comment docs.

@kimikage
Copy link
Collaborator Author

Benchmark

before

julia> @benchmark colordiff(a, b) setup=(a=rand(Lab); b=rand(Lab))
BenchmarkTools.Trial:
  memory estimate:  0 bytes
  allocs estimate:  0
  --------------
  minimum time:     165.744 ns (0.00% GC)
  median time:      202.635 ns (0.00% GC)
  mean time:        200.747 ns (0.00% GC)
  maximum time:     880.501 ns (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     759

after

julia> @benchmark colordiff(a, b) setup=(a=rand(Lab); b=rand(Lab))
BenchmarkTools.Trial:
  memory estimate:  0 bytes
  allocs estimate:  0
  --------------
  minimum time:     115.795 ns (0.00% GC)
  median time:      130.392 ns (0.00% GC)
  mean time:        132.842 ns (0.00% GC)
  maximum time:     1.039 μs (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     918

Incidentally, my main machine broke down the other day, and I'm currently using an older generation (Kaby Lake) machine. 😭 So we can't make a quantitative comparison with recent benchmark results.

julia> 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-7500U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

The new machine will have a different CPU type (Tiger Lake).

@kimikage kimikage force-pushed the de2000_sind_cosd branch from b86b7f8 to a5aca15 Compare July 1, 2021 13:59
@kimikage kimikage merged commit 219f387 into JuliaGraphics:master Jul 1, 2021
@kimikage kimikage deleted the de2000_sind_cosd branch July 1, 2021 14:14
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.

1 participant