JuliaApproximation / ApproxFunBase.jl

Core functionality of ApproxFun
MIT License
12 stars 13 forks source link

Faster iterate method for TrivialInterlacer #503

Closed jishnub closed 1 year ago

jishnub commented 1 year ago

On master,

julia> o = Ones{Int}(ℵ₀)
ℵ₀-element Ones{Int64, 1, Tuple{InfiniteArrays.OneToInf{Int64}}} with indices OneToInf()

julia> B = ApproxFunBase.BlockInterlacer((o, o))
ApproxFunBase.BlockInterlacer((Ones(ℵ₀), Ones(ℵ₀)))

julia> @btime first($B, 10);
  1.212 μs (28 allocations: 2.31 KiB)

julia> @btime Fun($(x->x^2), Chebyshev(-1..0)+Chebyshev(0..1));
  16.448 μs (140 allocations: 9.77 KiB)

This PR

julia> @btime first($B, 10);
  38.610 ns (1 allocation: 224 bytes)

julia> @btime Fun(x->x^2, Chebyshev(-1..0)+Chebyshev(0..1));
  14.697 μs (72 allocations: 4.97 KiB)
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.58% :warning:

Comparison is base (4f33475) 71.88% compared to head (002687e) 71.31%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #503 +/- ## ========================================== - Coverage 71.88% 71.31% -0.58% ========================================== Files 81 81 Lines 8546 8547 +1 ========================================== - Hits 6143 6095 -48 - Misses 2403 2452 +49 ``` | [Files Changed](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation) | Coverage Δ | | |---|---|---| | [src/LinearAlgebra/helper.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL0xpbmVhckFsZ2VicmEvaGVscGVyLmps) | `68.77% <100.00%> (-0.15%)` | :arrow_down: | | [src/Operators/banded/Conversion.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL09wZXJhdG9ycy9iYW5kZWQvQ29udmVyc2lvbi5qbA==) | `87.09% <100.00%> (+0.65%)` | :arrow_up: | | [src/eigen.jl](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation#diff-c3JjL2VpZ2VuLmps) | `96.42% <100.00%> (ø)` | | ... and [15 files with indirect coverage changes](https://app.codecov.io/gh/JuliaApproximation/ApproxFunBase.jl/pull/503/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaApproximation)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.