Draft
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #225 +/- ##
==========================================
- Coverage 91.60% 90.29% -1.32%
==========================================
Files 11 12 +1
Lines 1513 1535 +22
==========================================
Hits 1386 1386
- Misses 127 149 +22 ☔ View full report in Codecov by Sentry. |
Merged
Member
|
I haven't checked it very carefully, but maybe this is related to the performance gap to function sum_window_mean_ver1(X)
out = zero(float(eltype(X)))
R = CartesianIndices(X)
Δ = oneunit(eltype(R))
@inbounds @simd for p in R
window = max(p-Δ, first(R)):min(p+Δ, last(R))
out += mean(view(X, window))
end
return out
end
function sum_window_mean_ver2(X)
out = zero(float(eltype(X)))
R = CartesianIndices(X)
Δ = oneunit(eltype(R))
@inbounds @simd for p in R
window = max(p-Δ, first(R)):min(p+Δ, last(R))
mean_val = zero(eltype(out))
for q in window
mean_val += X[q]
end
out += mean_val/length(window)
end
return out
endjulia> @btime sum_window_mean_ver1($X);
164.748 μs (0 allocations: 0 bytes)
julia> @btime sum_window_mean_ver2($X)
64.137 μs (0 allocations: 0 bytes) |
Member
Author
|
Did you try creating your own |
This file contains hidden or 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
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.
Continued from #223
Closes #224