Mercurial > repos > public > sbplib_julia
changeset 1190:1aca445216b8 tooling/benchmarks
Clean up todos
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 27 Jan 2023 12:40:01 +0100 |
parents | 525015283843 |
children | 12b525cd3da6 |
files | benchmark/benchmarks.jl benchmark/run_and_view.jl |
diffstat | 2 files changed, 17 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/benchmark/benchmarks.jl Fri Jan 27 12:20:43 2023 +0100 +++ b/benchmark/benchmarks.jl Fri Jan 27 12:40:01 2023 +0100 @@ -9,26 +9,4 @@ SUITE["utf8"]["join"] = @benchmarkable join($teststr, $teststr) SUITE["utf8"]["plots"] = BenchmarkGroup() -# SUITE["trigonometry"] = BenchmarkGroup(["math", "triangles"]) -# SUITE["trigonometry"]["circular"] = BenchmarkGroup() -# for f in (sin, cos, tan) -# for x in (0.0, pi) -# SUITE["trigonometry"]["circular"][string(f), x] = @benchmarkable ($f)($x) -# end -# end - -# SUITE["trigonometry"]["hyperbolic"] = BenchmarkGroup() -# for f in (sin, cos, tan) -# for x in (0.0, pi) -# SUITE["trigonometry"]["hyperbolic"][string(f), x] = @benchmarkable ($f)($x) -# end -# end - SUITE - -# TODO: Add mercurial version of benchmarkpkg -# TODO: Make it easy to compare different commits. (A simple script?) - -# Should set HGPLAIN before script use. Example: `HGPLAIN= hg st` -# `hg id` for getting the revision -# `hg update --check` for updating, requires a clean working directory.
--- a/benchmark/run_and_view.jl Fri Jan 27 12:20:43 2023 +0100 +++ b/benchmark/run_and_view.jl Fri Jan 27 12:40:01 2023 +0100 @@ -21,7 +21,6 @@ open_in_default_browser(file_path) end -# TBD: What parts are PkgBenchmark contributing? Can it be stripped out? Can we replace the html output part? """ run_benchmark() @@ -42,7 +41,6 @@ Updates the repository to the given revison and runs the benchmark suite. When done, updates the repository to the origianl state. `rev` can be any identifier compatible with `hg update`. - Returns a `PkgBenchmark.BenchmarkResult` """ function run_benchmark(rev) @@ -75,8 +73,6 @@ return PkgBenchmark.judge(t,b,f; judgekwargs...) end -# TBD: How to compare against current working directory? Possible to create a temporary commit? - function add_rev_info(benchmarkresult, rev) return PkgBenchmark.BenchmarkResults( @@ -90,6 +86,7 @@ ) end + function write_result_html(io, r) iobuffer = IOBuffer() PkgBenchmark.export_markdown(iobuffer, r) @@ -102,7 +99,6 @@ dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HH:MM:SS") Mustache.render(io, template, Dict("title"=>dt, "content"=>content)) end -## Fix the writing of the commit, it chops off all the important info function write_result_html(r) dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HHMMSS") @@ -115,8 +111,10 @@ return file_path end + PkgBenchmark.date(j::PkgBenchmark.BenchmarkJudgement) = PkgBenchmark.date(PkgBenchmark.target_result(j)) + function hg_id() cmd = Cmd(`hg id`, dir=sbplib_root) return readchomp(addenv(cmd, "HGPLAIN"=>"")) @@ -132,6 +130,7 @@ run(addenv(cmd, "HGPLAIN"=>"")) end + # From Pluto.jl/src/webserver/WebServer.jl (2023-01-24) function open_in_default_browser(url::AbstractString)::Bool try @@ -152,7 +151,18 @@ end end + main -# TODO: Change color of codeblocks -# TODO: Change width of tables and code blocks +# TODO: Better logging of what is happening + +# TODO: Clean up the HTML output? + # TODO: Make the codeblocks in the table look nicer + # TODO: Change width of tables and code blocks so everything is visible + # TODO: Fix the commit id, it chops off all the important info + # TODO: Make title less verbose + # TBD: Do we have to replace export_markdown? Could use a template instead. + + +# TBD: How to compare against current working directory? Possible to create a temporary commit? +# TBD: What parts are PkgBenchmark contributing? Can it be stripped out?