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

strip tuple wrapper to speed up centroid calc #20

Merged
merged 1 commit into from Jun 6, 2019

Conversation

tlnagy
Copy link
Contributor

@tlnagy tlnagy commented Jun 5, 2019

continuation of JuliaImages/Images.jl#810

JuliaLang/julia#28980 seems unrelated because the 100x fold regression is fixed on master but this PR still yields about a 10% increase in median speed:

Images master

julia> a = rand(0:250, 1024, 1024);

julia> @benchmark Images.component_centroids(a)
BenchmarkTools.Trial: 
  memory estimate:  10.17 KiB
  allocs estimate:  4
  --------------
  minimum time:     1.972 ms (0.00% GC)
  median time:      2.748 ms (0.00% GC)
  mean time:        2.742 ms (0.00% GC)
  maximum time:     5.276 ms (0.00% GC)
  --------------
  samples:          1819
  evals/sample:     1

This PR

julia> @benchmark Images.component_centroids(a)
BenchmarkTools.Trial: 
  memory estimate:  10.31 KiB
  allocs estimate:  5
  --------------
  minimum time:     1.907 ms (0.00% GC)
  median time:      2.498 ms (0.00% GC)
  mean time:        2.489 ms (0.00% GC)
  maximum time:     3.595 ms (0.00% GC)
  --------------
  samples:          2000
  evals/sample:     1

julia> println(VERSION)
1.3.0-DEV.320

@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #20 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #20      +/-   ##
==========================================
+ Coverage   92.88%   92.94%   +0.05%     
==========================================
  Files           6        6              
  Lines         253      255       +2     
==========================================
+ Hits          235      237       +2     
  Misses         18       18
Impacted Files Coverage Δ
src/connected.jl 88.72% <100%> (+0.17%) ⬆️

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 ecd67e2...6bf89b6. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #20 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #20      +/-   ##
==========================================
+ Coverage   92.88%   92.94%   +0.05%     
==========================================
  Files           6        6              
  Lines         253      255       +2     
==========================================
+ Hits          235      237       +2     
  Misses         18       18
Impacted Files Coverage Δ
src/connected.jl 88.72% <100%> (+0.17%) ⬆️

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 ecd67e2...6bf89b6. Read the comment docs.

@timholy timholy merged commit 3495460 into JuliaImages:master Jun 6, 2019
@timholy
Copy link
Member

timholy commented Jun 6, 2019

Thanks!

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.

None yet

3 participants