#!/bin/bash # prepare 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 printf "\n" printf "Cycle:\n" (time ./code_cycle &>/dev/null) 2>&1 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 printf "\n" printf "Cycle:\n" (time go run ./code_cycle/ &>/dev/null) 2>&1 printf "\n" cd .. # Java printf -- "--- Java ---\n" cd Java make compile &> /dev/null printf "Unoptimised:\n" (time java code_unoptimised &>/dev/null) 2>&1 printf "\n" printf "Cycle:\n" (time java code_cycle &>/dev/null) 2>&1 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 printf "\n" printf "Cycle:\n" (time node code_cycle.js &>/dev/null) 2>&1 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 printf "\n" printf "Cycle:\n" (time java -jar code_cycle.jar &>/dev/null) 2>&1 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 printf "\n" printf "Cycle:\n" (time python3 code_cycle.py &>/dev/null) 2>&1 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 printf "\n" printf "Cycle:\n" (time ./code_cycle/target/release/code_cycle &>/dev/null) 2>&1 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 printf "\n" printf "Cycle:\n" (time node code_cycle.js &>/dev/null) 2>&1 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 printf "\n" printf "Cycle:\n" (time ./code_cycle/zig-out/bin/code_cycle &>/dev/null) 2>&1 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