A simple web benchmark of Go, Crystal, Rust, D, Scala, Node.js and Crystal.
OS: Mac OS X 10.13.3
Hardware: MacBook Pro (CPU: 2.3 GHz Intel Core i7, Mem: 16 GB 1600 MHz DDR3)
Software: Go 1.9.3, Rust 1.25.0-nightly, Scala 2.12.4, Node.js 9.4.0, DMD 2.078.1, LDC 1.7.0, Crystal 0.24.1, PHP 7.1.13.
OS: Microsoft Windows [Version 10.0.15063]
Hardware: Dell XPS (CPU: 2.6 GHz Intel Core i7, Mem: 16 GB 2133 MHz DDR4)
Software: Go 1.9.3, Rust 1.25.0-nightly, Scala 2.12.4, Node.js 9.4.0, DMD 2.078.1, LDC 1.7.0, Crystal 0.24.1 (under WSL).
OS: 4.4.0-43-Microsoft GNU/Linux
Hardware: Dell XPS (CPU: 2.6 GHz Intel Core i7, Mem: 16 GB 2133 MHz DDR4)
Software: Go 1.9.2, Rust 1.25.0-nightly, Scala 2.12.4, Node.js 9.4.0, DMD 2.078.1, LDC 1.7.0, Crystal 0.24.1, PHP 7.0.22.
The stats gathered by the hey tool (please run it twice for the JIT optimizations where it's applicable):
hey -n 50000 -c 256 -t 10 "http://127.0.0.1:3000/"
hey -n 50000 -c 256 -t 10 "http://127.0.0.1:3000/greeting/hello"
By default, MacOS has low limits on the number of concurrent connections, so few kernel parameters tweaks may be required:
sudo sysctl -w kern.ipc.somaxconn=12000
sudo sysctl -w kern.maxfilesperproc=1048576
sudo sysctl -w kern.maxfiles=1148576
Please use the Scala script (using sbt Script runner) to run all the tests automatically.
Usage: scalas suite/run.scala [options] <lang>...
-o, --out <file> image file to generate (result.png by default)
--verbose verbose execution output
<lang>... languages to test ('all' for all)
The following languages are supported: rust_hyper, rust_rocket, crystal, nodejs, go, scala, dmd, ldc2.
go run go/main.go
Using Crystal:
crystal run --release --no-debug crystal/server.cr
Alpine Linux note: please use crystal-alpine packages.
macOS note: linking with OpenSSL may require PKG_CONFIG_PATH changes.
Please install Nightly Rust.
Windows also requires MinGW
compiler toolchain with mingw-w64-x86_64-gcc
installed.
Sample applications use hyper HTTP library and Rocket web framework:
cargo run --manifest-path rust/hyper/Cargo.toml --release
cargo run --manifest-path rust/rocket/Cargo.toml --release
Two compilers are tested:
- DMD (a reference D compiler);
- LDC (LLVM-based D compiler). If ldc2 executable is not in path, please use the fully qualified path name.
Uses vibe.d framework:
dub run --root=d --compiler=dmd --build=release --config=dmd
dub run --root=d --compiler=ldc2 --build=release --config=ldc
Uses Akka toolkit:
gradle -p scala run --info
node nodejs/main.js
Uses standalone web server and Swoole extension:
php -S 127.0.0.1:3000 php/bare/main.php
php -c php/swoole/php.ini php/swoole/main.php
python3 python/main.py
Uses Sprint Boot project:
gradle -p java build
java -jar -Dserver.port=3000 java/build/libs/java-0.0.1-SNAPSHOT.jar