File tree Expand file tree Collapse file tree 7 files changed +46
-6
lines changed Expand file tree Collapse file tree 7 files changed +46
-6
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,7 @@ installdoc:
4040 git worktree add _wikidoc origin/wikidoc
4141 rsync -av doc-dev/ _wikidoc/doc/dev/
4242
43- .PHONY : all tests tests-wasm test runtest runtests doc clean installdoc
43+ bench :
44+ $(MAKE ) -C benchmarks bench
45+
46+ .PHONY : all tests tests-wasm test runtest runtests doc clean installdoc bench
Original file line number Diff line number Diff line change 1+ FROM ocaml/opam:debian-ocaml-5.3
2+ WORKDIR /bench-dir
3+ RUN sudo apt-get update && \
4+ sudo apt-get install -qq -yy --no-install-recommends pkg-config libgmp-dev \
5+ wget
6+ RUN sudo ln -sf /usr/bin/opam-2.3 /usr/bin/opam
7+ RUN opam remote add origin https://github.com/ocaml/opam-repository.git && \
8+ opam update
9+ RUN wget https://nodejs.org/dist/v22.14.0/node-v22.14.0-linux-x64.tar.xz && \
10+ tar xJvf node-v22.14.0-linux-x64.tar.xz
11+ ENV PATH="/bench-dir/node-v22.14.0-linux-x64/bin:$PATH"
12+ RUN wget https://github.com/WebAssembly/binaryen/releases/download/version_122/binaryen-version_122-x86_64-linux.tar.gz && \
13+ tar xzvf binaryen-version_122-x86_64-linux.tar.gz
14+ ENV PATH="/bench-dir/binaryen-version_122/bin:$PATH"
15+ RUN opam install --fake binaryen-bin
16+ COPY --chown=opam:opam ./*.opam ./
17+ RUN opam pin -yn --with-version=dev .
18+ RUN opam install -y --deps-only js_of_ocaml-compiler
19+ COPY --chown=opam:opam . ./
20+ RUN opam install -y wasm_of_ocaml-compiler
21+ WORKDIR ./benchmarks
Original file line number Diff line number Diff line change @@ -10,6 +10,18 @@ GRAPHSEFF = time-effects.pdf size-effects.pdf size-bzip2-effects.pdf
1010# For full benchs:
1111all : _perf graphsnopr graphspr graphseff _noperf
1212
13+ # This target is the one run by `current-bench`,
14+ # see https://github.com/ocurrent/current-bench
15+ .PHONY : bench
16+ bench :
17+ make _noprecomp
18+ $(RUN ) ./report-wasm-cb.config ./report-jsoo-cb.config
19+ $(REPORT ) -format current-bench -config report-wasm-cb.config \
20+ -ylabel " Wasm_of_ocaml"
21+ $(REPORT ) -format current-bench -config report-jsoo-cb.config \
22+ -ylabel " Js_of_ocaml"
23+
24+
1325graphsnopr : _noprecomp $(GRAPHSNOPR )
1426
1527graphspr : __precomp $(GRAPHSPR )
Original file line number Diff line number Diff line change 1+ histogramref times node js_of_ocaml #fbaf4f node
2+ histogram sizes "" js_of_ocaml/gzipped #ffffff Size (gzipped)
Original file line number Diff line number Diff line change 1+ histogram times node wasm_of_ocaml #ffffff node
2+ histogram sizes "" wasm_of_ocaml/gzipped #ffffff Generated Wasm (gzipped)
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ let file_size ?(wasm = false) param =
153153 let files =
154154 if wasm then src ^ " " ^ Filename. remove_extension src ^ " .assets/*" else src
155155 in
156- Format. sprintf " wc -c --total only %s > %s" files dst)
156+ Format. sprintf " cat %s | wc -c > %s" files dst)
157157
158158let compr_file_size ?(wasm = false ) param =
159159 compile_no_ext param ~comptime: false (fun ~src ~dst ->
Original file line number Diff line number Diff line change @@ -191,10 +191,10 @@ let random =
191191 | 31 | 32 -> - 1
192192 | _ -> int_of_string " 0xffffffff"
193193 in
194- let l_0xc761c23c = int_of_string " 0xc761c23c" in
195- let l_0xd3a2646c = int_of_string " 0xd3a2646c" in
196- let l_0xfd7046c5 = int_of_string " 0xfd7046c5" in
197- let l_0xb55a4f09 = int_of_string " 0xb55a4f09" in
194+ let l_0xc761c23c = Int64. of_string " 0xc761c23c" |> Int64. to_int in
195+ let l_0xd3a2646c = Int64. of_string " 0xd3a2646c" |> Int64. to_int in
196+ let l_0xfd7046c5 = Int64. of_string " 0xfd7046c5" |> Int64. to_int in
197+ let l_0xb55a4f09 = Int64. of_string " 0xb55a4f09" |> Int64. to_int in
198198 fun () ->
199199 (* // Robert Jenkins' 32 bit integer hash function. *)
200200 let s = ! seed in
You can’t perform that action at this time.
0 commit comments