We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I went to port Jackknife over to use InvertedIndices, but I noticed something... suboptimal.
Below are some timings for using InvertedIndices (thing1) and using the current naive approach for skipping indices (thing2).
thing1
thing2
julia> using InvertedIndices, Statistics, BenchmarkTools julia> thing1(f, x) = map(i->f(view(x, Not(i))), eachindex(x)) thing1 (generic function with 1 method) julia> thing2(f, x) = (is = eachindex(x); map(i->f(view(x, filter(!isequal(i), is))), is)) thing2 (generic function with 1 method) julia> x = randn(2000); julia> @benchmark thing1(mean, $x) BenchmarkTools.Trial: memory estimate: 792.91 MiB allocs estimate: 27954027 -------------- minimum time: 2.523 s (1.98% GC) median time: 2.564 s (2.81% GC) mean time: 2.564 s (2.81% GC) maximum time: 2.605 s (3.61% GC) -------------- samples: 2 evals/sample: 1 julia> @benchmark thing2(mean, $x) BenchmarkTools.Trial: memory estimate: 35.48 MiB allocs estimate: 28005 -------------- minimum time: 18.324 ms (3.89% GC) median time: 20.482 ms (10.97% GC) mean time: 20.770 ms (11.10% GC) maximum time: 64.851 ms (64.83% GC) -------------- samples: 241 evals/sample: 1
That's pretty hardcore. Am I doing something wrong in how I'm using it here?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I went to port Jackknife over to use InvertedIndices, but I noticed something... suboptimal.
Below are some timings for using InvertedIndices (
thing1
) and using the current naive approach for skipping indices (thing2
).That's pretty hardcore. Am I doing something wrong in how I'm using it here?
The text was updated successfully, but these errors were encountered: