Add profiling scripts

This commit is contained in:
maralorn 2022-09-28 23:06:09 +02:00
parent 76ab7bb9c0
commit 238a64113d
5 changed files with 23 additions and 1 deletions

3
bench/TODOS.txt Normal file
View file

@ -0,0 +1,3 @@
- [ ] deepseq deaktivieren und memory usage überprüfen (potentiell feinere deepseqs einführen)
- [ ] Input types ausfactorn
- [ ] Verschiedene JSON parser testen

2
bench/bench.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
cat bench/nom-shell-452e7d5.nix-log | cabal run nom +RTS -s

13
bench/profile.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
set -eu
FOLDER="bench/profile-run-$(date +'%Y-%m-%d-%H:%M:%S')"
mkdir -p "$FOLDER"
git show --oneline -q > "$FOLDER/git-status"
git status >> "$FOLDER/git-status"
git diff >> "$FOLDER/git-status"
cabal run --enable-profiling --ghc-option "-with-rtsopts=-p -l-au -s$FOLDER/allocations" -- nom < bench/nom-shell-452e7d5.nix-log
mv nom.eventlog "$FOLDER/eventlog"
mv nom.prof "$FOLDER/prof"
hs-speedscope "$FOLDER/eventlog"
echo See results in "$FOLDER/eventlog.json"

2
bench/slow-bench.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
cat bench/nom-shell-452e7d5.nix-log | pv --quiet --line-mode --rate-limit 20000 | cabal run nom +RTS -s

View file

@ -70,7 +70,7 @@
alejandra.enable = true;
nix-linter.enable = true;
statix.enable = true;
#fourmolu.enable = true; # disabled until fourmolo or ormolu can deal with RecordDotSyntax
fourmolu.enable = true; # disabled until fourmolo or ormolu can deal with RecordDotSyntax
cabal-fmt.enable = true;
shellcheck.enable = true;
};
@ -82,6 +82,8 @@
pre-commit-hooks.defaultPackage.${system}
haskellPackages.haskell-language-server
haskellPackages.cabal-install
haskellPackages.hs-speedscope
pkgs.pv
];
withHoogle = true;
inherit (self.checks.${system}.pre-commit-check) shellHook;