Skip to content

Commit

Permalink
Create Benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Apr 26, 2024
1 parent 37f65e2 commit e4840af
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/benchmark.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e4840af

Please sign in to comment.