mirror of
https://github.com/swarm-game/swarm.git
synced 2024-09-11 14:46:33 +03:00
b244a4223c
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`.
22 lines
549 B
Bash
Executable File
22 lines
549 B
Bash
Executable File
#!/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" |