-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
30x slower looping over reinterpret array #51658
Labels
performance
Must go faster
Comments
Moelf
changed the title
60x slower looping over reinterpret array
30x slower looping over reinterpret array
Oct 10, 2023
Perhaps #44186 might help? |
looks like it helps by almos 10x julia> @benchmark g(x) setup=begin x = copy(ARY) end
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
Range (min … max): 1.279 μs … 4.555 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 1.294 μs ┊ GC (median): 0.00%
Time (mean ± σ): 1.367 μs ± 164.712 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
█▅▂ ▇▄ ▁
████▆▄▃▄▄███▇▇▇▇▇▆▆▅▄▅▄▅▆▄▅▆▅▃▅▄▅▄▅▅▅▅▄▄▃▅▄▃▅▃▅▄▄▅▅▅▄▃▄▄▃▄▅ █
1.28 μs Histogram: log(frequency) by time 2.17 μs <
Memory estimate: 0 bytes, allocs estimate: 0.
julia> @benchmark g(x) setup=begin x = deepcopy(ARY) end
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
Range (min … max): 43.471 μs … 79.852 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 44.035 μs ┊ GC (median): 0.00%
Time (mean ± σ): 45.352 μs ± 3.060 μs ┊ GC (mean ± σ): 0.00% ± 0.00%
▇█▆▅▃▂ ▁▁▁▁▂▅▅▃▂▁▁▁▁ ▂
█████████████████████████▇▇▇▇▇▆▇▆▆▆▆▅▅▅▅▅▅▃▄▄▃▄▃▃▁▅▄▄▁▄▄▄▄▆ █
43.5 μs Histogram: log(frequency) by time 60.9 μs <
Memory estimate: 0 bytes, allocs estimate: 0. |
on nightly it's still the same: julia> @benchmark g(x) setup=begin x = copy(ARY) end
BenchmarkTools.Trial: 7593 samples with 10 evaluations.
Range (min … max): 1.280 μs … 5.617 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 1.288 μs ┊ GC (median): 0.00%
Time (mean ± σ): 1.513 μs ± 655.006 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
█ ▂▁
████▇▇▆▆▅▄▄▄▃▃▄▃▃▃▆▆▄▅▄▆▇▇▆▇▇▇█▆▇▆▇▆▆▆▆▆▇▆▆▆▆▆▆▆▅▆▅▆▅▅▅▄▅▅▅ █
1.28 μs Histogram: log(frequency) by time 4.32 μs <
Memory estimate: 0 bytes, allocs estimate: 0.
julia> @benchmark g(x) setup=begin x = deepcopy(ARY) end
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
Range (min … max): 42.522 μs … 87.246 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 42.767 μs ┊ GC (median): 0.00%
Time (mean ± σ): 43.293 μs ± 2.071 μs ┊ GC (mean ± σ): 0.00% ± 0.00%
▄█▇▃▂▂▁ ▃▃ ▁
███████▇█▆▅▅▄▄▃▄▃▅▄▅▆▆▅▆▅▅▅▆▆▆▆▅▆▄▅▅▇███▅▆▅▅▅▅▄▅▄▄▄▃▄▄▄▄▄▃▃ █
42.5 μs Histogram: log(frequency) by time 49.9 μs <
Memory estimate: 0 bytes, allocs estimate: 0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
previous saga:
.+=
) significanctly slower for reinterpreted array #48801ntoh
/bswap
are 10x slower when operating in-place onreinterpret
array #42227that's a 300x slowdown?
notice, it's faster to first copy...
The text was updated successfully, but these errors were encountered: