git.iko.soy/typeable/cassava-streams
on trunk help sign in
Profile the tutorial program
commit03a403c41cd8c5f104fba28b93a36366563c5b48 authorPeter Jones <pjones@pmade.com> dateThu 24 Apr 2014, 16:38 (12 years ago) parent3a85b20
4 files changed+29−1
.gitignore+1 GNUmakefile+26 test/header.csv+1 util+1−1
.gitignore+1
@@ -1,3 +1,4 @@
11/dist
22/.cabal-sandbox
33/cabal.sandbox.config
4+/test/massive.csv
GNUmakefile+26
@@ -2,3 +2,29 @@
22# From util/haskell.mk (git submodule update --init)
33CABAL_FLAGS = --enable-tests -fmaintainer -ftutorial
44include util/haskell.mk
5+
6+################################################################################
7+CSV_HEADER = test/header.csv
8+CSV_MEGA = test/massive.csv
9+RAND_ROW = openssl rand -base64 1048576 | paste -sd/
10+TUTORIAL = dist/build/tutorial/tutorial todo
11+PROF_OPTS = +RTS -sstderr -hc -pa -xc
12+
13+################################################################################
14+clean::
15+ rm -f $(CSV_MEGA)
16+ rm -f $(foreach e,aux hp pdf prof ps,tutorial.$(e))
17+
18+################################################################################
19+profile:: $(CSV_MEGA)
20+ $(TUTORIAL) $(PROF_OPTS) < $(CSV_MEGA) > /dev/null
21+ hp2ps -M -b -c tutorial.hp
22+ ps2pdf tutorial.ps
23+
24+################################################################################
25+# Generate a very large CSV file for profiling.
26+$(CSV_MEGA): $(CSV_HEADER)
27+ cp $(CSV_HEADER) $@
28+ for n in `seq 1024`; do (printf "TODO,"; $(RAND_ROW)) >> $@; printf .; done
29+ @ echo # print a newline
30+ du -h $@
test/header.csvnew file+1
@@ -0,0 +1 @@
1+State,Title
util+1−1

Submodule changed.