add profiling for ocaml
This commit is contained in:
parent
2d5378fd53
commit
cf76c92803
|
@ -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.
Loading…
Reference in New Issue
Block a user