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 overflow_check #150

Merged
merged 1 commit into from
Sep 18, 2020
Merged

optimize overflow_check #150

merged 1 commit into from
Sep 18, 2020

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.

1 participant