1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00
ReCo.jl/src/benchmark.jl

23 lines
651 B
Julia
Raw Normal View History

2021-11-26 02:35:39 +00:00
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