mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2025-09-04 09:12:35 +00:00
benchmarks
This commit is contained in:
parent
092b0438d3
commit
10018160e2
5 changed files with 33 additions and 9 deletions
|
@ -1 +1,23 @@
|
|||
using BenchmarkTools
|
||||
function run_benchmarks()
|
||||
benchmark_exprs = [:(run_sim(; N=1000, T=5, v=20.0, snapshot_at=0.1, save_data=false))]
|
||||
|
||||
for expr in benchmark_exprs
|
||||
benchmark = @benchmark eval(expr)
|
||||
|
||||
display(benchmark)
|
||||
|
||||
open("benchmark.txt", "a+") do f
|
||||
json = JSON3.pretty(
|
||||
Dict(
|
||||
"benchmark" => repr(expr),
|
||||
"datetime" => now(),
|
||||
"mean_time/ns" => mean(benchmark.times),
|
||||
"allocs" => benchmark.allocs,
|
||||
"memory" => benchmark.memory,
|
||||
),
|
||||
)
|
||||
|
||||
write(f, json)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue