Skip to content

Commit

Permalink
Split Step.hs (#1665)
Browse files Browse the repository at this point in the history
Both `execConst` and `stepCESK` are huge case statements.  This refactor puts them in different modules.

Also many supporting functions for implementing commands in `execConst` are moved to their own modules.

Whereas `Step.hs` previously had `2931` lines, the new linecounts are:

| File | lines |
| --- | --- |
| `Step.hs` | 848 |
| `Arithmetic.hs` | 124 |
| `Const.hs` | 1687 |
| `Command.hs` | 417 |

The only tricky thing was that `execConst` is mutually recursive with `runCESK`.  So to get them into different modules, I pass a wrapper of `runCESK` as an argument to `execConst`.
  • Loading branch information
kostmo authored Nov 28, 2023
1 parent e03251c commit b244a42
Show file tree
Hide file tree
Showing 6 changed files with 2,283 additions and 2,112 deletions.
22 changes: 22 additions & 0 deletions scripts/benchmark-against-parent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -xe

# Requires that the working tree be clean.

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR/..

if git diff --quiet --exit-code
then
echo "Working tree is clean. Starting benchmarks..."
else
echo "Working tree is dirty! Quitting."
exit 1
fi

BASELINE_OUTPUT=baseline.csv

git checkout HEAD~
stack bench --benchmark-arguments "--csv $BASELINE_OUTPUT --color always"

git switch -
stack bench --benchmark-arguments "--baseline $BASELINE_OUTPUT --fail-if-slower 3 --color always"
Loading

0 comments on commit b244a42

Please sign in to comment.