Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions run_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ echo $out

nprocs=`cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l`

if [ ! -z "$MALLOC_TRIM_THRESHOLD_" ]; then
old_trim_threshold=$MALLOC_TRIM_THRESHOLD_
fi

sudo apt-get install -y build-essential bc golang

export GOPATH="$(dirname "$(readlink -f "$0")")"
Expand Down Expand Up @@ -38,6 +42,17 @@ if [ ! -f ./bench ]; then
fi
cd ..

disable_malloc_trim_threshold () {
export MALLOC_TRIM_THRESHOLD_=-1
}

restore_malloc_trim_threshold () {
if [ ! -z "$old_trim_threshold" ]; then
export MALLOC_TRIM_THRESHOLD_=$old_trim_threshold
else
unset MALLOC_TRIM_THRESHOLD_
fi
}

openssl_aead () {
res=`./openssl/apps/openssl speed -seconds 10 -bytes 16384 -multi $2 -evp $1 | tail -1 | rev | cut -f 1 -d ' ' | rev | sed 's/k//' `
Expand Down Expand Up @@ -93,9 +108,11 @@ for q in {4..11}; do
done

echo "gzip performance (cloudflare zlib)" | tee -a $out
disable_malloc_trim_threshold
for q in {4..9}; do
echo gzip -$q,$( comp $q 1 ),$( comp $q $nprocs ) | tee -a $out
done
restore_malloc_trim_threshold

echo "Go performance" | tee -a $out
go run ./go_benchmarks.go | tee -a $out