Skip to content

Conversation

@johnnychen94
Copy link
Member

@johnnychen94 johnnychen94 commented Sep 18, 2020

Even with JuliaLang/julia#37558 fixed, it seems we still need such optimization to minimize the overhead in overflow check.

# Version 1.6.0-DEV.965 (2020-09-18)

julia> a = zeros(5,5,5,5);

# with overflow check (master)
julia> @btime OffsetArray($a, -2:2, -2:2, -2:2, -2:2);
  33.057 ns (0 allocations: 0 bytes)

# with overflow check (this PR)
julia> @btime OffsetArray($a, -2:2, -2:2, -2:2, -2:2);
  16.556 ns (0 allocations: 0 bytes)

# without overflow check
julia> @btime OffsetArray($a, -2:2, -2:2, -2:2, -2:2);
  13.515 ns (0 allocations: 0 bytes)

@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #150 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #150   +/-   ##
=======================================
  Coverage   93.60%   93.60%           
=======================================
  Files           2        2           
  Lines         250      250           
=======================================
  Hits          234      234           
  Misses         16       16           
Impacted Files Coverage Δ
src/OffsetArrays.jl 94.17% <100.00%> (ø)

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 93e60d3...f770fde. Read the comment docs.

@johnnychen94 johnnychen94 merged commit f741df9 into master Sep 18, 2020
@johnnychen94 johnnychen94 deleted the jc/overflow branch September 18, 2020 11:45
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.

2 participants