1
0
forked from GitHub/gf-core

Minor additions to LPGF readme

This commit is contained in:
John J. Camilleri
2021-08-27 09:32:43 +02:00
parent 1ce1cea068
commit b47eb18f86

View File

@@ -74,6 +74,7 @@ stack bench --work-dir .stack-work-bench --benchmark-arguments "run lpgf Phraseb
## Profiling
```
stack build --work-dir .stack-work-profile --profile --bench --no-run-benchmarks &&
stack bench --work-dir .stack-work-profile --profile --benchmark-arguments "compile lpgf testsuite/lpgf/phrasebook/PhrasebookFre.gf +RTS -T -p -h -RTS"
```
@@ -81,10 +82,20 @@ Produced files:
- `lpgf-bench.prof` - total time and memory allocation (`-p`)
- `lpgf-bench.hp` - heap profile (`-h`)
Open heap profile graph on-the-fly:
```
stack exec -- hp2ps -c lpgf-bench.hp && open lpgf-bench.ps
```
Convert and copy timestamped files into `PROF/`:
```
TS="$(date +%Y-%m-%d_%H%M)" &&
stack exec -- hp2ps -c lpgf-bench.hp &&
mv lpgf-bench.prof PROF/$TS.prof &&
mv lpgf-bench.ps PROF/$TS.ps &&
mv lpgf-bench.hs PROF/$TS.hp
```
**Resources**
- https://downloads.haskell.org/ghc/8.6.5/docs/html/users_guide/profiling.html