-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (52 loc) · 1.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# if you want to use analyze-ocaml-instrumented, set this to a source
# checkout of OCaml 4.03 or later
OCAML_SOURCES=~/Prog/ocaml/github-trunk
all:
@echo "see Makefile for targets"
# compile Haskell program
haskell: Main.hs
ghc -O2 -optc-O3 Main.hs
clean::
rm -f Main.o Main.hi
# run Haskell program and report times
run-haskell: haskell
./Main +RTS -s 2> haskell.log
cat haskell.log
analyze-haskell:
@echo "Worst old-generation pause:"
@cat haskell.log | grep "Gen 1" | sed "s/ /\n/g" | tail -n 1
# compile OCaml program
ocaml: main.ml
ocamlbuild -use-ocamlfind main.native
clean::
ocamlbuild -clean
# run OCaml program; only reports the last time
run-ocaml: ocaml
./main.native
# you need to "raco pkg install gcstats" first
run-racket:
PLT_INCREMENTAL_GC=1 racket -l gcstats -t main.rkt | tee racket.log
analyze-racket:
@grep "Max pause time" racket.log
# run Racket program with debug instrumentation
run-racket-instrumented: main.rkt
PLTSTDERR=debug@GC PLT_INCREMENTAL_GC=1 racket main.rkt 2> racket.log
# collect histogram from debug instrumentation,
# to be used *after* run-racket
analyze-racket-instrumented:
cat racket.log | grep -v total | cut -d' ' -f7 | sort -n | uniq --count
# these will only work if OCaml has been built with --with-instrumented-runtime
ocaml-instrumented: main.ml
ocamlbuild -use-ocamlfind -tag "runtime_variant(i)" main.native
run-ocaml-instrumented: ocaml-instrumented
OCAML_INSTR_FILE="ocaml.log" ./main.native
analyze-ocaml-instrumented:
$(OCAML_SOURCES)/tools/ocaml-instr-report ocaml.log | grep "dispatch:" -A13
java: Main.java
javac Main.java
clean::
rm -f Main.class
run-java: java
java -verbosegc -cp . Main
run-java-g1: java
java -XX:+UseG1GC -verbosegc -cp . Main