diff --git a/test/benchmark.jl b/test/benchmark.jl new file mode 100644 index 0000000..0af142e --- /dev/null +++ b/test/benchmark.jl @@ -0,0 +1,18 @@ + +@testset "benchmarks" begin + rng = Xoshiro(42) + iter = Iterators.filter(x -> x != 10, 1:10^4) + wv(el) = 1.0 + for m in (algR, algL, algRSWRSKIP) + b = @benchmark itsample($rng, $iter, 10, $m) evals=1 + println("Method $m") + println(" Time: $(round(median(b.times)*1e-3, digits=2)) μs") + println(" Memory: $(b.memory) bytes") + end + for m in (algARes, algAExpJ, algWRSWRSKIP) + b = @benchmark itsample($rng, $iter, $wv, 10, $m) evals=1 + println("Method $m") + println(" Time: $(round(median(b.times)*1e-3, digits=2)) μs") + println(" Memory: $(b.memory) bytes") + end +end