1
0
Fork 0
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:
MoBit 2021-11-26 03:35:39 +01:00
parent 092b0438d3
commit 10018160e2
5 changed files with 33 additions and 9 deletions

View file

@ -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