comparison benchmark/run_and_view.jl @ 1180:37f29a3a78dc tooling/benchmarks

Add some comments
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 27 Jan 2023 11:31:07 +0100
parents d6038ceba882
children f49bac53e72b
comparison
equal deleted inserted replaced
1179:d6038ceba882 1180:37f29a3a78dc
12 function main() 12 function main()
13 r = run_benchmark() 13 r = run_benchmark()
14 file_path = write_result_html(r) 14 file_path = write_result_html(r)
15 open_in_default_browser(file_path) 15 open_in_default_browser(file_path)
16 end 16 end
17
18 # TBD: What parts are PkgBenchmark contributing? Can it be stripped out? Can we replace the html output part?
17 19
18 function run_benchmark() 20 function run_benchmark()
19 r = PkgBenchmark.benchmarkpkg(Sbplib) 21 r = PkgBenchmark.benchmarkpkg(Sbplib)
20 22
21 commit = hg_id() 23 commit = hg_id()
41 template = Mustache.load(template_path) 43 template = Mustache.load(template_path)
42 44
43 dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HH:MM:SS") 45 dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HH:MM:SS")
44 Mustache.render(io, template, Dict("title"=>dt, "content"=>content)) 46 Mustache.render(io, template, Dict("title"=>dt, "content"=>content))
45 end 47 end
48 ## Fix the writing of the commit, it chops off all the important info
46 49
47 function write_result_html(r) 50 function write_result_html(r)
48 dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HHMMSS") 51 dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HHMMSS")
49 file_path = joinpath(results_dir, dt*".html") 52 file_path = joinpath(results_dir, dt*".html")
50 53