-
-
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
mapslices performance #26868
Comments
Better on 0.7, but not parity:
Edit: Both Lines 1940 to 1958 in 8f46450
are |
JuliennedArrays might help in this case: julia> @benchmark mapslices(V, X, 1)
BenchmarkTools.Trial:
memory estimate: 267.02 MiB
allocs estimate: 11999527
--------------
minimum time: 750.878 ms (2.31% GC)
median time: 782.824 ms (2.33% GC)
mean time: 803.105 ms (3.38% GC)
maximum time: 905.073 ms (2.32% GC)
--------------
samples: 7
evals/sample: 1
julia> @benchmark f(V, X)
BenchmarkTools.Trial:
memory estimate: 53.41 MiB
allocs estimate: 1000006
--------------
minimum time: 23.018 ms (5.64% GC)
median time: 25.374 ms (5.97% GC)
mean time: 37.715 ms (32.41% GC)
maximum time: 101.140 ms (67.24% GC)
--------------
samples: 133
evals/sample: 1
julia> using JuliennedArrays
julia> @benchmark map(V, julienne(X, (:,*)))
BenchmarkTools.Trial:
memory estimate: 53.41 MiB
allocs estimate: 1000006
--------------
minimum time: 26.012 ms (5.17% GC)
median time: 28.425 ms (5.71% GC)
mean time: 41.413 ms (30.04% GC)
maximum time: 109.614 ms (65.14% GC)
--------------
samples: 121
evals/sample: 1 There are plans to migrate it into Base: #23645 (comment) |
Updated timings on latest nightly:
|
...and just for fun,
|
Timing with #40996:
This example is one for which you only need half of mapslices, since |
Consider the following piece of code:
Timing on this reveals:
which is substantially different.
Note that in this simple example, my data could be a column vector; however, this is a surrogate for problems where I have time series data and
X
is d x n with 1< d << n.The text was updated successfully, but these errors were encountered: