summaryrefslogtreecommitdiff
path: root/base64/Makefile
blob: 611abcf64f8ce9ba9dfed4df005c5e50532ef2e6 (plain)
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
#
# Some GHC flags explained
#
# -v			verbose mode
# -O2			level 2 optimizations
# -rtsopts		allow +RTS flags
# -prof			enable basic time and allocation profiling
# -auto-all		cost centers on all top level functions
#  			(you can also add them via the SCC pragma)
# -caf-all      	generate data for CAFs (constant applicative forms)
#  			t
# -fforce-recomp 	force recompilation
#
# Notes: you will obtain the profiling versions of dependancies via: 
#        stack install --profile [libraryname]
#
# 	-fprof-auto replaced -auto-all
# 	-fprof-cafs replaced -caf-all
#

build-prof:
	stack ghc --profile -- -rtsopts -prof -fprof-auto -fprof-cafs -O2 base64.hs 

#
# Some +RTS flags
#
# -p	profiling
# -K 	set stack limit
# -hc 	extract heap profile
# -hy	allocation by type
# -hd   allocation by constructor
# -iN   sampling frequency in seconds. e.g. -i0.01
# -ddump-simpl generate core version 
#
# Note: render the heap profile as graph with: hp2ps -e8in -c file.hp
#

run-prof:
	cat random.bin | ./base64 +RTS -p -K100M > /dev/null


test-mini-hask:
	stack ghc -- -O mini.hs
test-mini-c:
	gcc -O3 mini.c -o mini.out