Commit 04d425d096c9d62b598ee18c71fa6f10048cab37 Parent: dd887ab4dff2f47110b7f584e357e86826b76369 Author: mcol <mcol@posteo.net> Date: 2022-11-27 16:20:52 +0000 Committer: mcol <mcol@posteo.net> Committed: 2022-11-27 18:12:23 +0000 add some make commands for profiling
Makefile Modified
@@ -2,7 +2,7 @@ .PHONY: build build: ## Compile the binary (Default) - @stack build + @stack build --keep-going .PHONY: help help: ## Show this help @@ -38,16 +38,31 @@ test: ## Run the "tests" bash ./test/test.sh +.PHONY: all +all: format lint rebuild run test ## Lint, format, rebuild, run, test + .PHONY: prod prod: ## Build with optimise flags @stack build --ghc-options="-O2" +.PHONY: dot +dot: ## Visualise dependencies + stack dot --external --depth 1 --prune base,text,bytestring,transformers \ + | twopi -Goverlap=false -Tpng -o deps.png + +PROF ?= fprof-auto +# other options: fno-prof-auto fprof-auto-top + .PHONY: prof -prof: ## Build with profiling enabled - @stack build --profile - @rm -r output - @stack exec --profile -- gitja -q +RTS -p - @head -n 6 gitja.prof +prof: _prof_build ## Build with profiling enabled + stack exec --profile -- gitja -q +RTS -p -po${PROF} + ghc-prof-flamegraph ${PROF}.prof -o ${PROF}.svg -.PHONY: all -all: format lint rebuild run test ## Lint, format, rebuild, run, test +.PHONY: prof_speedscope +prof_speedscope: _prof_build ## Build with profiling enabled (JSON output with speedscope) + stack exec --profile -- gitja -q +RTS -p -po${PROF} -pj + speedscope ${PROF}.prof + +_prof_build: + stack build --profile --ghc-options="-${PROF}" + rm -fr output
.gitignore Modified
@@ -4,3 +4,4 @@ test/result dist-newstyle *.prof +*.svg