clean up benchmarking scripts

This commit is contained in:
Balazs Komuves 2023-10-17 11:22:11 +02:00
parent b5afc94752
commit 46084e1413
14 changed files with 79 additions and 17 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
.DS_store
a.out
build
target
a.out

View File

@ -1,7 +1,7 @@
#!/bin/bash
ORIG=`pwd`
cd ../../src/Blake3/
cd ../../../src/Blake3/
IMPL=`pwd`
cd $IMPL
@ -11,7 +11,10 @@ cd $IMPL/b3sum
cargo build --release
cd $ORIG
cp $IMPL/b3sum/target/release/b3sum .
gcc -O3 fakedata.c -o fakedata
mkdir -p build
cp $IMPL/b3sum/target/release/b3sum build/
gcc -O3 fakedata.c -o build/fakedata

14
hash/cpu/bench/Blake3/Unix/run.sh Normal file → Executable file
View File

@ -1,2 +1,14 @@
#!/bin/bash
./fakedata $ZKBENCH_MEGABYTES | ./b3sum --num-threads $ZKBENCH_NTHREADS -
if [ -z ${ZKBENCH_NTHREADS} ]; then
ZKBENCH_NTHREADS=1
fi
if [ -z ${ZKBENCH_MEGABYTES} ]; then
ZKBENCH_MEGABYTES=256
fi
echo "NTHREADS = $ZKBENCH_NTHREADS"
echo "MEGABYTES = $ZKBENCH_MEGABYTES"
./build/fakedata $ZKBENCH_MEGABYTES | ./build/b3sum --num-threads $ZKBENCH_NTHREADS -

View File

@ -3,6 +3,8 @@ echo "build"
ZIK_PATH="../../../src/zikkurat-algebra/"
mkdir -p build
gcc -O3 \
-I ${ZIK_PATH}/lib/cbits/bigint/ \
-I ${ZIK_PATH}/lib/cbits/curves/fields/std/ \
@ -11,4 +13,4 @@ gcc -O3 \
${ZIK_PATH}/lib/cbits/curves/fields/std/bn128_r_std.c \
${ZIK_PATH}/lib/cbits/curves/fields/mont/bn128_r_mont.c \
poseidon2.c \
-o a.out
-o build/a.out

View File

@ -1,3 +1,14 @@
#!/bin/bash
./a.out $ZKBENCH_TREE_DEPTH $ZKBENCH_NTHREADS
if [ -z ${ZKBENCH_NTHREADS} ]; then
ZKBENCH_NTHREADS=1
fi
if [ -z ${ZKBENCH_TREE_DEPTH} ]; then
ZKBENCH_TREE_DEPTH=16
fi
echo "NTHREADS = $ZKBENCH_NTHREADS"
echo "TREE_DEPTH = $ZKBENCH_TREE_DEPTH"
./build/a.out $ZKBENCH_TREE_DEPTH $ZKBENCH_NTHREADS

View File

@ -1,2 +0,0 @@
#!/bin/bash
echo "setup"

View File

@ -1,4 +1,6 @@
#!/bin/bash
gcc -O3 sha2.c bench_linear.c -o bench_linear
gcc -O3 sha2.c bench_merkle.c -o bench_merkle
mkdir -p build
gcc -O3 sha2.c bench_linear.c -o build/bench_linear
gcc -O3 sha2.c bench_merkle.c -o build/bench_merkle

30
hash/cpu/bench/SHA256/C/run.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
if [ -z ${ZKBENCH_WHICH} ]; then
ZKBENCH_WHICH="LINEAR"
fi
if [ -z ${ZKBENCH_NTHREADS} ]; then
ZKBENCH_NTHREADS=1
fi
if [ -z ${ZKBENCH_MEGABYTES} ]; then
ZKBENCH_MEGABYTES=128
fi
echo "WHICH = $ZKBENCH_WHICH"
echo "NTHREADS = $ZKBENCH_NTHREADS"
echo "MEGABYTES = $ZKBENCH_MEGABYTES"
case $ZKBENCH_WHICH in
LINEAR)
build/bench_linear $ZKBENCH_MEGABYTES
;;
MERKLE)
build/bench_merkle $ZKBENCH_MEGABYTES $ZKBENCH_NTHREADS
;;
*)
echo "unknown selector: \`$ZKBENCH_WHICH\`"
exit 99
;;
esac

View File

@ -1,2 +0,0 @@
#!/bin/bash
echo "setup"

0
hash/cpu/bench/SHA256/C/sha2.c Executable file → Normal file
View File

0
hash/cpu/bench/SHA256/C/sha2.h Executable file → Normal file
View File

View File

@ -1,3 +1,5 @@
#!/bin/bash
gcc -O3 fakedata.c -o fakedata
mkdir -p build
gcc -O3 fakedata.c -o build/fakedata

View File

@ -1,3 +1,9 @@
#!/bin/bash
./fakedata $ZKBENCH_MEGABYTES | shasum -a256 -b -
if [ -z ${ZKBENCH_MEGABYTES} ]; then
ZKBENCH_MEGABYTES=128
fi
echo "MEGABYTES = $ZKBENCH_MEGABYTES"
./build/fakedata $ZKBENCH_MEGABYTES | shasum -a256 -b -

View File

@ -1,2 +0,0 @@
#!/bin/bash
echo "setup"