commit cf76c92803ea9e76282ad22d17e7f01b778eb74d
parent 2d5378fd534321d11ca5ec22804210860d2c6833
Author: NunoSempere <nuno.sempere@protonmail.com>
Date: Sun, 15 Oct 2023 02:08:42 +0100
add profiling for ocaml
Diffstat:
4 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ocaml/makefile b/ocaml/makefile
@@ -3,6 +3,7 @@ OC=ocamlopt
# ocamlopt: platform-specific, faster
# ocamlc: platform-independent intermediate representation, run with ocamlrun
FAST=-O3 -unsafe # install flambda with opam
+PROF=-g
SRC=samples.ml
OUT=./out/samples
@@ -21,6 +22,13 @@ fast:
time:
bash -c "time $(OUT)"
+profile:
+ $(OC) $(PERF) $(SRC) -o $(OUT)
+ mv samples.cmi samples.cmx samples.o ./out/
+ sudo perf record -g $(OUT)
+ sudo perf report
+ rm perf.data
+
switch-opam-fast:
opam switch create 4.11.2+flambda
eval $(opam env)
diff --git a/ocaml/out/samples b/ocaml/out/samples
Binary files differ.
diff --git a/ocaml/out/samples.cmx b/ocaml/out/samples.cmx
Binary files differ.
diff --git a/ocaml/out/samples.o b/ocaml/out/samples.o
Binary files differ.