Skip to content

Conversation

@chriselrod
Copy link
Contributor

using BenchmarkTools
N = 5; data4big = randn(N,N,N,N,100); data4view = @view data4big[:,:,:,:,5];
@benchmark pointer($data4view)

Before:

julia> @benchmark pointer($data4view)
BenchmarkTools.Trial:
  memory estimate:  848 bytes
  allocs estimate:  21
  --------------
  minimum time:     1.480 μs (0.00% GC)
  median time:      1.562 μs (0.00% GC)
  mean time:        1.654 μs (1.72% GC)
  maximum time:     288.553 μs (98.46% GC)
  --------------
  samples:          10000
  evals/sample:     10

After:

julia> @benchmark pointer($data4view)
BenchmarkTools.Trial:
  memory estimate:  0 bytes
  allocs estimate:  0
  --------------
  minimum time:     2.658 ns (0.00% GC)
  median time:      2.672 ns (0.00% GC)
  mean time:        2.686 ns (0.00% GC)
  maximum time:     12.688 ns (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1000

@KristofferC
Copy link
Member

KristofferC commented Sep 7, 2020

Seems like a pretty bad performance bug so I think it makes sense to backport this

@KristofferC KristofferC merged commit 1e6d771 into JuliaLang:master Sep 8, 2020
@chriselrod chriselrod deleted the specialize__memory_offset branch September 8, 2020 10:19
KristofferC pushed a commit that referenced this pull request Sep 9, 2020
@KristofferC KristofferC mentioned this pull request Sep 9, 2020
29 tasks
KristofferC pushed a commit that referenced this pull request Sep 10, 2020
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