-
Notifications
You must be signed in to change notification settings - Fork 4
/
bench
executable file
·36 lines (36 loc) · 936 Bytes
/
bench
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh -e
echo "Very cool language benchmark script"
echo "---"
echo "Node.js $(node -v)"
node perf.js
echo "---"
echo "Lua (LuaJIT) $(luajit -v | awk '{print $1, $2}')"
luajit perf.lua
echo "---"
echo "Rust $(rustc --version)"
rustc perf.rs -C opt-level=3 -C codegen-units=1 -C lto=true -C target-cpu=native -o perfrs
./perfrs
echo "---"
echo "Go $(go version | awk '{print $3, $4}')"
go run perf.go
echo "---"
echo "Python (PyPy3) $(pypy3 --version)"
pypy3 perf.py
echo "---"
echo "C (GCC) $(gcc --version | head -n 1)"
gcc perf.c -Ofast -march=native -mtune=native -o perfc
./perfc
echo "---"
echo "C++ (G++) $(g++ --version | head -n 1)"
g++ perf.cpp -std=c++11 -march=native -mtune=native -Ofast -o perfcpp
./perfcpp
echo "---"
echo "C# $(dotnet --version)"
cd perfcsharpsrc
dotnet run --configuration Release --verbosity quiet
cd ..
echo "---"
echo "Java $(java -version 2>&1 | head -n 1)"
javac perf.java
java perf
echo "---"