summaryrefslogtreecommitdiff
path: root/base64/Makefile
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2019-03-02 12:50:34 +0100
committerMiguel <m.i@gmx.at>2019-03-02 12:50:34 +0100
commit76718c0ec3717c4f9e5b0f659ab829f4b92419d2 (patch)
treef0d5e17dc85c9dadd5e2e2e0dc73c24a5e2f4e92 /base64/Makefile
parenta97b3edf385a1fd69899ea8fe23889fa0d206079 (diff)
playing with some haskell code
Diffstat (limited to 'base64/Makefile')
-rw-r--r--base64/Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/base64/Makefile b/base64/Makefile
new file mode 100644
index 0000000..611abcf
--- /dev/null
+++ b/base64/Makefile
@@ -0,0 +1,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