add profiling for ocaml

This commit is contained in:
NunoSempere 2023-10-15 02:08:42 +01:00
parent 2d5378fd53
commit cf76c92803
4 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@ OC=ocamlopt
# ocamlopt: platform-specific, faster # ocamlopt: platform-specific, faster
# ocamlc: platform-independent intermediate representation, run with ocamlrun # ocamlc: platform-independent intermediate representation, run with ocamlrun
FAST=-O3 -unsafe # install flambda with opam FAST=-O3 -unsafe # install flambda with opam
PROF=-g
SRC=samples.ml SRC=samples.ml
OUT=./out/samples OUT=./out/samples
@ -21,6 +22,13 @@ fast:
time: time:
bash -c "time $(OUT)" 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: switch-opam-fast:
opam switch create 4.11.2+flambda opam switch create 4.11.2+flambda
eval $(opam env) eval $(opam env)

Binary file not shown.

Binary file not shown.

Binary file not shown.