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

Optimize distinguishable_colors #506

Merged

Conversation

kimikage
Copy link
Collaborator

@kimikage kimikage commented Jul 31, 2021

This changes the type used for internal operations from Lab{Float64} to Lab{Float32}.
This also removes the unnecessary sRGB gamma operations and deleteat!.

Note that @nospecialize is almost useless because of the keyword arguments.

julia> @btime distinguishable_colors(10);
  10.832 ms (896527 allocations: 14.88 MiB) # master w/o recompilation
  5.104 ms (50998 allocations: 1.50 MiB)    # master w/ recompilation
  2.675 ms (9070 allocations: 213.08 KiB)   # this PR

Closes #477

@codecov
Copy link

codecov bot commented Jul 31, 2021

Codecov Report

Merging #506 (ea591e3) into master (f71d7a1) will increase coverage by 1.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
+ Coverage   93.84%   95.34%   +1.49%     
==========================================
  Files           9        9              
  Lines        1154     1160       +6     
==========================================
+ Hits         1083     1106      +23     
+ Misses         71       54      -17     
Impacted Files Coverage Δ
src/colormaps.jl 98.13% <100.00%> (+3.08%) ⬆️
src/conversions.jl 99.38% <100.00%> (+<0.01%) ⬆️
src/utilities.jl 98.25% <0.00%> (-0.44%) ⬇️
src/algorithms.jl 75.00% <0.00%> (+14.04%) ⬆️

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 f71d7a1...ea591e3. Read the comment docs.

This changes the type used for internal operations from `Lab{Float64}` to `Lab{Float32}`.
This also removes the unnecessary sRGB gamma operations and `deleteat!`.
@kimikage kimikage force-pushed the optimize_distinguishable_colors branch from 1f71420 to ea591e3 Compare July 31, 2021 05:33
@kimikage kimikage merged commit f7fddbd into JuliaGraphics:master Aug 2, 2021
@kimikage kimikage deleted the optimize_distinguishable_colors branch August 2, 2021 16:40
@kimikage
Copy link
Collaborator Author

kimikage commented Aug 2, 2021

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.

Optimizing the types used for intermediate calculations
1 participant