Add benchmark.sh

This commit is contained in:
James Hoffman 2025-04-06 18:13:17 -06:00
parent 6d10b83ab1
commit 95febf51f7

10
benchmark.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
mkdir ./.time-bench
hyperfine --prepare 'if test -d demo/.time; then rm -r ./.time-bench && cp -rT demo/.time ./.time-bench; fi && rm -rf demo && cp -r demo.bak demo' './target/release/ftm -c ./config.json' 'cd demo && git init && git add ./* && git commit -m "Add demo"' --export-json initial_run.json --runs 30
du -hs .time-bench # .time is copied in the prepare step
rm -r .time-bench
du -hs demo/.git
hyperfine --prepare 'rm -rf demo && cp -r demo.bak demo && ./target/release/ftm -c ./config.json && cd demo && git init && git add ./* && git commit -m "Add demo" && cd .. && rm -r demo/* && cp -r src demo/' './target/release/ftm -c ./config.json' 'cd demo && git add ./* && git commit -m "Update to src"' --export-json second-run.json --runs 30
du -hs demo/.time
du -hs demo/.git