Skip to content

Commit 4555c07

Browse files
committed
ReadMe: Profiling: add straight-forward effective instructive example
1 parent 9d03e52 commit 4555c07

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

ReadMe.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,21 @@ To build `hnix` with profiling enabled:
129129
```shell
130130
cabal v2-run hnix --enable-profiling --flags=profiling -- <args> +RTS -p
131131
```
132-
where "RTS" stands for "RunTime System" and has a lot of options, GHC User Manual has ["Running a compiled program"/"Setting RTS options"](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/runtime_control.html) sections describing them.
132+
133+
Or to put simply:
134+
```shell
135+
# Run profiling for evaluation of a Firefox package.
136+
# Generate:
137+
# * for all functions
138+
# * time profiling data
139+
# * memory allocation profiling data
140+
# * in the JSON profiling format
141+
cabal v2-run --enable-profiling --flags=profiling --enable-library-profiling --profiling-detail='all-functions' hnix -- --eval --expr '(import <nixpkgs> {}).firefox.outPath' +RTS -Pj
142+
143+
# Then, upload the `hnix.prof` to the https://www.speedscope.app/ to analyze it.
144+
```
145+
146+
"RTS" stands for "RunTime System" and has a lot of options, GHC User Manual has ["Running a compiled program"/"Setting RTS options"](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/runtime_control.html) sections describing them.
133147

134148
##### Full debug info
135149

0 commit comments

Comments
 (0)