Add benchmark script (#13224)
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
1 parent
bbbeeb07f6
commit
2c77149e6a
8 files changed
+74
-4
No files matched your search
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
commits=("${@}")
|
||||
|
||||
root=`git rev-parse --show-toplevel`
|
||||
cd "$root/scripts/benchmark"
|
||||
|
||||
function cleanup {
|
||||
echo Cleaning up...
|
||||
rm -rf "${commits[@]}"
|
||||
echo Done!
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
args=()
|
||||
|
||||
for commit in "${commits[@]}"; do
|
||||
rm -rf $commit
|
||||
git -C "$root" archive $commit --prefix $commit/ ':!tests*' ':!website' ':!docs' | tar -x
|
||||
(cd $commit; yarn; yarn build)
|
||||
args+=("node ./bench.mjs $commit serial")
|
||||
args+=("node ./bench.mjs $commit parallel")
|
||||
done
|
||||
|
||||
hyperfine --warmup 3 "${args[@]}"
|
||||
Reference in new issue
Block a user