Skip to content

Commit d467e1b

Browse files
committed
Benchmark: Camlboy
1 parent ac9ba78 commit d467e1b

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

bench.Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,10 @@ RUN eval $(opam env) \
4949
&& dune build --root janestreet --profile release lib/bonsai_web_components/partial_render_table/bench/bin/main.bc.wasm.js lib/bonsai_web_components/partial_render_table/bench/bin/main.bc.js
5050
RUN cp -r janestreet/_build/default/lib/bonsai_web_components/partial_render_table/bench/bin/main.bc.* ./benchmarks/benchmark-partial-render-table
5151

52+
# CAMLBOY
53+
RUN opam install brr \
54+
&& git clone --depth 1 https://github.com/ocaml-wasm/CAMLBOY -b node \
55+
&& cd CAMLBOY \
56+
&& opam exec -- dune build --root . --profile release ./bin/web
57+
5258
WORKDIR ./benchmarks

benchmarks/benchmark-camlboy/Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.PHONY: bench perform
2+
3+
export NAME=Camlboy
4+
5+
SHELL=/bin/bash -o pipefail
6+
7+
SCRIPT=../../CAMLBOY/_build/default/bin/web/bench_node.bc
8+
ROM=../../CAMLBOY/resource/games/tobu.gb
9+
10+
bench:
11+
$(MAKE) perform COMPILER=Js_of_ocaml SUFFIX=.js
12+
$(MAKE) perform COMPILER=Wasm_of_ocaml SUFFIX=.wasm.js
13+
14+
perform:
15+
node $(SCRIPT)$(SUFFIX) $(ROM) | \
16+
tee /dev/stderr | \
17+
ocaml -I +str str.cma output_results.ml $(COMPILER)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
let () =
2+
Format.printf
3+
{|{ "name": "%s",
4+
"results":
5+
[ { "name": "Camlboy",
6+
"metrics":
7+
[ { "name": "Frames per second",
8+
"units": "Hz",
9+
"value": %s } ] } ] }@.|}
10+
Sys.argv.(1)
11+
(read_line ())

0 commit comments

Comments
 (0)