Basic-benchmark-experiment/www/scripts/full-benchmark-unbuffered-c...

195 lines
3.3 KiB
Bash
Raw Permalink Normal View History

2024-03-11 12:43:52 +02:00
#!/bin/bash
# prepare
source time-aggregation.sh
cd /home/shared-space-1/presentation/code/
# C
printf -- "--- C ---\n"
cd C
make compile &> /dev/null
printf "Unoptimised:\n"
#(time ./code_unoptimised &>/dev/null) 2>&1
benchmark 100 ./code_unoptimised
printf "\n"
printf "Cycle:\n"
#(time ./code_cycle &>/dev/null) 2>&1
benchmark 100 ./code_cycle
printf "\n"
make clean &> /dev/null
cd ..
# Go
printf -- "--- Go ---\n"
cd Go
printf "Unoptimised:\n"
#(time go run ./code_unoptimised/ &>/dev/null) 2>&1
benchmark 100 'go run ./code_unoptimised/'
printf "\n"
printf "Cycle:\n"
#(time go run ./code_cycle/ &>/dev/null) 2>&1
benchmark 100 'go run ./code_cycle/'
printf "\n"
cd ..
# Java
printf -- "--- Java ---\n"
cd Java
make compile &> /dev/null
printf "Unoptimised:\n"
#(time java code_unoptimised &>/dev/null) 2>&1
benchmark 100 'java code_unoptimised'
printf "\n"
printf "Cycle:\n"
#(time java code_cycle &>/dev/null) 2>&1
benchmark 100 'java code_cycle'
printf "\n"
make clean &> /dev/null
cd ..
# JavaScript
printf -- "--- JavaScript ---\n"
cd JavaScript
printf "Unoptimised:\n"
#(time node code_unoptimised.js &>/dev/null) 2>&1
benchmark 100 'node code_unoptimised.js'
printf "\n"
printf "Cycle:\n"
#(time node code_cycle.js &>/dev/null) 2>&1
benchmark 100 'node code_cycle.js'
printf "\n"
cd ..
# Kotlin
printf -- "--- Kotlin ---\n"
cd Kotlin
make compile-on-premise &> /dev/null
printf "Unoptimised:\n"
#(time java -jar code_unoptimised.jar &>/dev/null) 2>&1
benchmark 100 'java -jar code_unoptimised.jar'
printf "\n"
printf "Cycle:\n"
#(time java -jar code_cycle.jar &>/dev/null) 2>&1
benchmark 100 'java -jar code_cycle.jar'
printf "\n"
make clean &> /dev/null
cd ..
# Python
printf -- "--- Python ---\n"
cd Python
printf "Unoptimised:\n"
#(time python3 code_unoptimised.py &>/dev/null) 2>&1
benchmark 1 'python3 code_unoptimised.py'
printf "\n"
printf "Cycle:\n"
#(time python3 code_cycle.py &>/dev/null) 2>&1
benchmark 1 'python3 code_cycle.py'
printf "\n"
cd ..
# Rust
printf -- "--- Rust ---\n"
cd Rust
make compile &> /dev/null
printf "Unoptimised:\n"
#(time ./code_unoptimised/target/release/code_unoptimised &>/dev/null) 2>&1
benchmark 100 './code_unoptimised/target/release/code_unoptimised'
printf "\n"
printf "Cycle:\n"
#(time ./code_cycle/target/release/code_cycle &>/dev/null) 2>&1
benchmark 100 './code_cycle/target/release/code_cycle'
printf "\n"
make clean &> /dev/null
cd ..
# TypeScript
printf -- "--- TypeScript ---\n"
cd TypeScript
# using precompiled version because the local compiler is borked
printf "Unoptimised:\n"
#(time node code_unoptimised.js &>/dev/null) 2>&1
benchmark 100 'node code_unoptimised.js'
printf "\n"
printf "Cycle:\n"
#(time node code_cycle.js &>/dev/null) 2>&1
benchmark 100 'node code_cycle.js'
printf "\n"
cd ..
# Zig
printf -- "--- Zig ---\n"
cd Zig
make compile-on-premise &> /dev/null
printf "Unoptimised:\n"
#(time ./code_unoptimised/zig-out/bin/code_unoptimised &>/dev/null) 2>&1
benchmark 100 './code_unoptimised/zig-out/bin/code_unoptimised'
printf "\n"
printf "Cycle:\n"
#(time ./code_cycle/zig-out/bin/code_cycle &>/dev/null) 2>&1
benchmark 100 './code_cycle/zig-out/bin/code_cycle'
printf "\n"
make clean &> /dev/null
cd ..
# send
#cd /home/shared-space-1/presentation/code/www/scripts/
#RESULT_STRING=$(cat $TEMP_FILE)
#printf -- "Content-Type: text/plain\r\n\r\n%s" "$RESULT_STRING"
#rm $TEMP_FILE