Skip to content

Commit

Permalink
make num of runs same
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyus committed Oct 7, 2023
1 parent 2cef8ee commit cccf06b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ run_python() {
source venv/bin/activate &&
pip freeze | grep orjson || pip install -r requirements.txt &&
if [ $HYPER == 1 ]; then
capture "Python" hyperfine -r 5 --show-output "python3 ./related.py"
capture "Python" hyperfine -r 10 -w 3 --show-output "python3 ./related.py"
else
command time -f '%es %Mk' python3 ./related.py
fi
Expand All @@ -131,7 +131,7 @@ run_python_np() {
source venv/bin/activate &&
(pip freeze | grep scipy && pip freeze | grep orjson) || pip install -r requirements.txt &&
if [ $HYPER == 1 ]; then
capture "Numpy" hyperfine -r 5 --show-output "python3 ./related_np.py"
capture "Numpy" hyperfine -r 10 -w 3 --show-output "python3 ./related_np.py"
else
command time -f '%es %Mk' python3 ./related_np.py
fi
Expand All @@ -145,7 +145,7 @@ run_crystal() {
cd ./crystal &&
crystal build --release src/crystal.cr &&
if [ $HYPER == 1 ]; then
capture "Crystal" hyperfine -r 10 --show-output "./crystal"
capture "Crystal" hyperfine -r 10 -w 5 --show-output "./crystal"
else
command time -f '%es %Mk' ./crystal
fi
Expand All @@ -159,7 +159,7 @@ run_zig() {
cd ./zig &&
zig build-exe -lc -O ReleaseFast main.zig
if [ $HYPER == 1 ]; then
capture "Zig" hyperfine -r 10 -w 3 --show-output "./main"
capture "Zig" hyperfine -r 10 -w 5 --show-output "./main"
else
command time -f '%es %Mk' ./main
fi
Expand All @@ -172,7 +172,7 @@ run_julia() {
cd ./julia &&
julia -e 'using Pkg; Pkg.add.(["JSON3", "StructTypes", "StaticArrays", "StrideArrays"])' &&
if [ $HYPER == 1 ]; then
capture "Julia" hyperfine -r 5 --warmup 1 --show-output "julia related.jl"
capture "Julia" hyperfine -r 10 -w 5 --show-output "julia related.jl"
else
command time -f '%es %Mk' julia related.jl
fi
Expand All @@ -185,7 +185,7 @@ run_odin() {
cd ./odin &&
odin build related.odin -file -o:speed &&
if [ $HYPER == 1 ]; then
capture "Odin" hyperfine -r 10 --show-output "./related"
capture "Odin" hyperfine -r 10 -w 5 --show-output "./related"
else
command time -f '%es %Mk' ./related
fi
Expand All @@ -198,7 +198,7 @@ run_vlang() {
cd ./v &&
v -prod -skip-unused related.v &&
if [ $HYPER == 1 ]; then
capture "Vlang" hyperfine -r 5 --show-output "./related"
capture "Vlang" hyperfine -r 10 -w 5 --show-output "./related"
else
command time -f '%es %Mk' ./related
fi
Expand All @@ -223,7 +223,7 @@ run_dart() {
echo "Running Dart VM" &&
cd ./dart &&
if [ $HYPER == 1 ]; then
capture "Dart VM" hyperfine -r 5 --warmup 3 --show-output "dart related.dart"
capture "Dart VM" hyperfine -r 10 --warmup 3 --show-output "dart related.dart"
else
command time -f '%es %Mk' dart related.dart
fi
Expand All @@ -236,7 +236,7 @@ run_dart_aot() {
cd ./dart &&
dart compile exe related.dart -o related &&
if [ $HYPER == 1 ]; then
capture "Dart AOT" hyperfine -r 5 --warmup 3 --show-output "./related"
capture "Dart AOT" hyperfine -r 10 --warmup 3 --show-output "./related"
else
command time -f '%es %Mk' ./related
fi
Expand All @@ -249,7 +249,7 @@ run_swift() {
cd ./swift &&
swift build -c release &&
if [ $HYPER == 1 ]; then
capture "Swift" hyperfine -r 10 --show-output "./.build/release/related"
capture "Swift" hyperfine -r 10 -w 5 --show-output "./.build/release/related"
else
command time -f '%es %Mk' "./.build/release/related"
fi
Expand All @@ -262,7 +262,7 @@ run_swift_con() {
cd ./swift_con &&
swift build -c release &&
if [ $HYPER == 1 ]; then
capture "Swift Concurrent" hyperfine -r 10 --show-output "./.build/release/related"
capture "Swift Concurrent" hyperfine -r 10 -w 5 --show-output "./.build/release/related"
else
command time -f '%es %Mk' "./.build/release/related"
fi
Expand All @@ -278,9 +278,9 @@ run_js() {
title=$(echo "$1" | sed 's/\b\(.\)/\u\1/g')

if [ "$1" = "deno" ]; then
capture "JS ($title)" hyperfine -r 5 --show-output "deno run --allow-read --allow-write deno.js"
capture "JS ($title)" hyperfine -r 10 -w 3 --show-output "deno run --allow-read --allow-write deno.js"
else
capture "JS ($title)" hyperfine -r 5 --show-output "$1 $1.js"
capture "JS ($title)" hyperfine -r 10 -w 3 --show-output "$1 $1.js"
fi

else
Expand Down Expand Up @@ -349,7 +349,7 @@ run_nim() {
./src/related &&
nim compile -d:release --threads:off --passL:"-flto -fprofile-use" --passC:"-flto -fprofile-use" src/related.nim &&
if [ $HYPER == 1 ]; then
capture "Nim" hyperfine -r 10 -w 2 --show-output "./src/related"
capture "Nim" hyperfine -r 10 -w 5 --show-output "./src/related"
else
command time -f '%es %Mk' ./src/related
fi
Expand All @@ -363,7 +363,7 @@ run_fsharp() {
dotnet restore &&
dotnet publish -c release &&
if [ $HYPER == 1 ]; then
capture "F#" hyperfine -r 5 -w 2 --show-output "./bin/release/net7.0/fsharp"
capture "F#" hyperfine -r 10 -w 5 --show-output "./bin/release/net7.0/fsharp"
else
command time -f '%es %Mk' ./bin/release/net7.0/fsharp
fi
Expand All @@ -377,7 +377,7 @@ run_csharp() {
dotnet restore &&
dotnet publish -c release --self-contained -o "bin/release/net7.0/publish" &&
if [ $HYPER == 1 ]; then
capture "C#" hyperfine -r 5 -w 2 --show-output "./bin/release/net7.0/publish/related"
capture "C#" hyperfine -r 10 -w 5 --show-output "./bin/release/net7.0/publish/related"
else
command time -f '%es %Mk' ./bin/release/net7.0/publish/related
fi
Expand All @@ -391,7 +391,7 @@ run_fsharp_con() {
dotnet restore &&
dotnet publish -c release &&
if [ $HYPER == 1 ]; then
capture "F# Concurrent" hyperfine -r 5 -w 2 --show-output "./bin/release/net7.0/fsharp_con"
capture "F# Concurrent" hyperfine -r 10 -w 5 --show-output "./bin/release/net7.0/fsharp_con"
else
command time -f '%es %Mk' ./bin/release/net7.0/fsharp_con
fi
Expand All @@ -404,7 +404,7 @@ run_luajit() {
cd ./lua &&
sudo luarocks --lua-version 5.1 install luasocket &&
if [ $HYPER == 1 ]; then
capture "LuaJIT" hyperfine -r 5 -w 2 --show-output "luajit only_lua.lua"
capture "LuaJIT" hyperfine -r 10 -w 5 --show-output "luajit only_lua.lua"
else
command time -f '%es %Mk' luajit only_lua.lua
fi
Expand All @@ -418,7 +418,7 @@ run_lua() {
sudo luarocks install luasocket &&
cd ./lua &&
if [ $HYPER == 1 ]; then
capture "Lua" hyperfine -r 5 -w 2 --show-output "lua only_lua.lua"
capture "Lua" hyperfine -r 10 -w 2 --show-output "lua only_lua.lua"
else
command time -f '%es %Mk' lua only_lua.lua
fi
Expand Down

0 comments on commit cccf06b

Please sign in to comment.