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

Performance regression on master in views #29872

Closed
KristofferC opened this issue Oct 31, 2018 · 0 comments · Fixed by #29873
Closed

Performance regression on master in views #29872

KristofferC opened this issue Oct 31, 2018 · 0 comments · Fixed by #29873
Assignees
Labels
arrays [a, r, r, a, y, s] performance Must go faster regression Regression in behavior compared to a previous version

Comments

@KristofferC
Copy link
Sponsor Member

#29795 was backported to the 1.0.2 backport branch and was found to give performance regressions (see report in #29444 (comment)). These also exist on master, @vtjnash.

Reproduced with

julia> function perf_laplace_iter_sub(N)
           u = zeros(N, N)
           u[1,:] .= 1
           Niter = 2^10
           dx2 = dy2 = 0.1*0.1
           u0 = view(u, 2:N-1, 2:N-1)
           u1 = view(u, 1:N-2, 2:N-1)
           u2 = view(u, 3:N,   2:N-1)
           u3 = view(u, 2:N-1, 1:N-2)
           u4 = view(u, 2:N-1, 3:N)
           for i = 1:Niter
               u0 .= ((u1 .+ u2).*dy2 .+ (u3 .+ u4).*dx2) .* (1 / (2*(dx2+dy2)))
           end
           return u
       end
perf_laplace_iter_sub (generic function with 1 method)

julia> using BenchmarkTools

julia> @btime perf_laplace_iter_sub(100);
  5.321 s (157364231 allocations: 4.98 GiB)

On julia 1.0.1 this takes:

julia> @btime perf_laplace_iter_sub(100);
  127.267 ms (12295 allocations: 300.89 MiB)
@KristofferC KristofferC added performance Must go faster regression Regression in behavior compared to a previous version arrays [a, r, r, a, y, s] labels Oct 31, 2018
vtjnash added a commit that referenced this issue Oct 31, 2018
vtjnash added a commit that referenced this issue Oct 31, 2018
KristofferC pushed a commit that referenced this issue Nov 28, 2018
KristofferC pushed a commit that referenced this issue Dec 12, 2018
KristofferC pushed a commit that referenced this issue Feb 11, 2019
KristofferC pushed a commit that referenced this issue Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] performance Must go faster regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants