- Haskell 93.6%
- Nix 6.4%
|
Teo Camarasu
8f49c295e9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
|
||
|---|---|---|
| app | add export lists | |
| .gitignore | Initial commit | |
| .woodpecker.yml | rename job to build | |
| CHANGELOG.md | Initial commit | |
| flake.lock | update flake | |
| flake.nix | update flake | |
| LICENSE | Initial commit | |
| README.md | fix typo | |
| shell.nix | Initial commit | |
| shortstraw.cabal | split out ModGraph module | |
Shortstraw -- a tool for analyzing GHC parallel builds
Overview
There are broadly two ways in which GHC can build haskell projects in parallel.
-
Package/unit level parallelism
This is enabled by passing "-j" to cabal-install/stack.
-
Module level parallelism
This is enabled by passing "-j" to GHC, eg, via "--ghc-options".
This package deals with the second type of parallelism. This type of parallelism is crucial for compilling large Haskell packages in a reasonable amount of time.
Yet, the effectiveness of this parallelism is limited by the critical path of the package. A linear chain of heavy modules can easily starve this parallelism.
This package gives us tools to analyze this critical path.
Status
This project is quite unstable. At the moment it only caters to my specific needs. If you are interested in a different type of analysis, please open an issue and I'd be happy to discuss it.
How to use
The executable exposed by this package reads verbose logs from GHC on stdin and outputs the critical path on stdout.
To create these logs you need to pass -v2 to GHC. I also recommend running GHC with -j1 as this gives the most accurate statistics and avoids issues with lines being mangled by parallel logging.