175 lines
2.3 KiB
Bash
175 lines
2.3 KiB
Bash
#!/bin/bash
|
|
|
|
# prepare
|
|
cd /home/shared-space-1/presentation/code/
|
|
|
|
# C
|
|
printf -- "--- C ---\n"
|
|
cd C
|
|
make compile
|
|
|
|
printf "Unoptimised:\n"
|
|
(time ./code_unoptimised) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time ./code_cycle) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
make clean &> /dev/null
|
|
cd ..
|
|
|
|
# Go
|
|
|
|
printf -- "--- Go ---\n"
|
|
cd Go
|
|
|
|
printf "Unoptimised:\n"
|
|
(time go run ./code_unoptimised/) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time go run ./code_cycle/) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
cd ..
|
|
|
|
# Java
|
|
|
|
printf -- "--- Java ---\n"
|
|
cd Java
|
|
make compile
|
|
|
|
printf "Unoptimised:\n"
|
|
(time java code_unoptimised) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time java code_cycle) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
make clean &> /dev/null
|
|
cd ..
|
|
|
|
# JavaScript
|
|
|
|
printf -- "--- JavaScript ---\n"
|
|
cd JavaScript
|
|
|
|
printf "Unoptimised:\n"
|
|
(time node code_unoptimised.js) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time node code_cycle.js) 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) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time java -jar code_cycle.jar) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
make clean
|
|
cd ..
|
|
|
|
# Python
|
|
|
|
printf -- "--- Python ---\n"
|
|
cd Python
|
|
|
|
printf "Unoptimised:\n"
|
|
(time python3 code_unoptimised.py) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time python3 code_cycle.py) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
cd ..
|
|
|
|
# Rust
|
|
|
|
printf -- "--- Rust ---\n"
|
|
cd Rust
|
|
make compile
|
|
|
|
printf "Unoptimised:\n"
|
|
(time ./code_unoptimised/target/release/code_unoptimised) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time ./code_cycle/target/release/code_cycle) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
make clean
|
|
cd ..
|
|
|
|
# TypeScript
|
|
|
|
printf -- "--- TypeScript ---\n"
|
|
cd TypeScript
|
|
# using precompiled version because the local compiler is borked
|
|
|
|
printf "Unoptimised:\n"
|
|
(time node code_unoptimised.js) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time node code_cycle.js) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
cd ..
|
|
|
|
# Zig
|
|
|
|
printf -- "--- Zig ---\n"
|
|
cd Zig
|
|
make compile-on-premise
|
|
|
|
printf "Unoptimised:\n"
|
|
(time ./code_unoptimised/zig-out/bin/code_unoptimised) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
printf "Cycle:\n"
|
|
(time ./code_cycle/zig-out/bin/code_cycle) 2>&1
|
|
|
|
printf "\n"
|
|
|
|
make clean
|
|
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
|