JuliaArrays / OffsetArrays.jl

Fortran-like arrays with arbitrary, zero or negative starting indices.
Other
198 stars 40 forks source link

Version limit OffsetUnitRange mapreduce #293

Closed jishnub closed 2 years ago

jishnub commented 2 years ago

There used to be a performance boost on Julia 1.6, but I don't see any on 1.7, I guess there have been improvements in Base, which makes this unnecessary now.

On v1.7.2

julia> r = 5:100000;

julia> ro = OffsetArrays.IdOffsetRange(r)
OffsetArrays.IdOffsetRange(values=5:100000, indices=1:99996)

julia> roa = OffsetArray(r, 2)
5:100000 with indices 3:99998

julia> @btime mapreduce(x -> x^2, +, $ro);
  1.459 μs (0 allocations: 0 bytes)

julia> @btime mapreduce(x -> x^2, +, $roa);
  1.567 μs (0 allocations: 0 bytes)
codecov[bot] commented 2 years ago

Codecov Report

Merging #293 (5ed267c) into master (26de770) will decrease coverage by 0.45%. The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
- Coverage   95.67%   95.21%   -0.46%     
==========================================
  Files           5        5              
  Lines         439      439              
==========================================
- Hits          420      418       -2     
- Misses         19       21       +2     
Impacted Files Coverage Δ
src/OffsetArrays.jl 96.89% <60.00%> (-0.69%) :arrow_down:

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 26de770...5ed267c. Read the comment docs.

jishnub commented 2 years ago

I am not certain why codecov complains, this should be tested on v1.0?

Edit: I've looked at the report, seems spurious