Skip to content

Commit

Permalink
Merge pull request #978 from Julow/oci-bench
Browse files Browse the repository at this point in the history
driver: Record execution time of every commands
  • Loading branch information
Julow authored Oct 2, 2023
2 parents 68a4d5b + b5ce93c commit da24899
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 2,177 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ publish-docs:
test :
dune runtest

.PHONY : bench
bench:
@dune build @bench

.PHONY : coverage
coverage :
dune build --instrument-with bisect_ppx @test/runtest --no-buffer -j 1 --force || true
Expand Down
2,384 changes: 216 additions & 2,168 deletions doc/driver.mld

Large diffs are not rendered by default.

25 changes: 16 additions & 9 deletions doc/dune
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@
; odoc_for_authors.mld
; parent_child_spec.mld))

; The driver is also used to collect benchmarks. The benchmark result is always
; generated but is promoted only by the @bench alias.

(rule
(alias docgen)
(deps
(:x driver.mld)
(glob_files *.ml*)
(glob_files *.png)
(glob_files library_mlds/*.mld)
(package odoc))
(targets driver.mld.corrected driver-benchmarks.json)
(enabled_if
(> %{ocaml_version} 4.11))
(deps
(package odoc)
(universe) ; Benchmark depends on the running time of odoc commands
(glob_files *.mld)
(glob_files library_mlds/*)
(glob_files examples/*.ml*))
(action
(run ocaml-mdx-test --force-output %{dep:driver.mld})))

(rule
(alias docgen)
(action
(progn
(run ocaml-mdx-test %{x})
(diff? %{x} %{x}.corrected))))
(diff driver.mld driver.mld.corrected))))
5 changes: 5 additions & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
(release
(flags
(:standard -g -w -18-53))))

(rule
(alias bench)
(action
(cat doc/driver-benchmarks.json)))
44 changes: 44 additions & 0 deletions odoc-bench.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
opam-version: "2.0"

version: "dev"
homepage: "http://github.com/ocaml/odoc"
doc: "https://ocaml.github.io/odoc/"
bug-reports: "https://github.com/ocaml/odoc/issues"
license: "ISC"

maintainer: [
"Daniel Bünzli <[email protected]>"
"Jon Ludlam <[email protected]>"
"Jules Aguillon <[email protected]>"
"Paul-Elliot Anglès d'Auriac <[email protected]>"
]
authors: [
"Anton Bachin <[email protected]>"
"Daniel Bünzli <[email protected]>"
"David Sheets <[email protected]>"
"Jon Ludlam <[email protected]>"
"Jules Aguillon <[email protected]>"
"Leo White <[email protected]>"
"Lubega Simon <[email protected]>"
"Paul-Elliot Anglès d'Auriac <[email protected]>"
"Thomas Refis <[email protected]>"
]
dev-repo: "git+https://github.com/ocaml/odoc.git"

synopsis: "Meta package defining dependencies for the benchmark rule. Not released."

depends: [
"astring"
"cmdliner" {>= "1.0.0"}
"cppo" {build & >= "1.1.0"}
"dune" {>= "3.7.0"}
"fpath"
"ocaml" {>= "4.02.0"}
"result"
"tyxml" {>= "4.3.0"}
"fmt"
"ocamlfind"
"bos"
"yojson" {>= "1.6.0"}
"mdx" {>= "2.3.0"}
]

0 comments on commit da24899

Please sign in to comment.