All nbody problem benchmarks

Current benchmark data was generated on Sat Nov 16 2024, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 165ms 2.7ms 1.8MB 153ms 0ms rustc 1.82.0
cpp 0-i.cpp 166ms 0.2ms 1.5MB 160ms 0ms g++ 11.4.0
cpp 0-i.cpp 170ms 0.3ms 2.3MB 160ms 0ms clang++ 14.0.0-1ubuntu1.1
rust 7-i.rs 236ms 1.4ms 1.9MB 230ms 0ms rustc 1.82.0
rust 1.rs 239ms 0.6ms 1.8MB 223ms 0ms rustc 1.82.0
c 8-i.c 247ms 0.9ms 1.5MB 233ms 0ms zigcc 0.13.0
zig 2.zig 273ms 0.3ms 1.1MB 263ms 0ms zig 0.13.0
rust 2.rs 278ms 0.5ms 1.8MB 270ms 0ms rustc 1.82.0
rust 3.rs 280ms 0.3ms 1.8MB 270ms 0ms rustc 1.84.0-nightly
c 5.c 299ms 0.1ms 1.5MB 290ms 0ms zigcc 0.13.0
c 8-i.c 302ms 2.2ms 2.1MB 290ms 0ms clang 14.0.0-1ubuntu1.1
c 2.c 308ms 0.9ms 2.3MB 300ms 0ms gcc 14.2.0
v 1.v 311ms 2.7ms 1.8MB 300ms 0ms v/clang 0.4.8
c 5.c 311ms 0.1ms 2.3MB 300ms 0ms gcc 14.2.0
v 1.v 311ms 0.7ms 2.4MB 300ms 0ms v/clang+gc 0.4.8
cpp 1.cpp 313ms 1.4ms 1.9MB 300ms 0ms g++ 11.4.0
zig 1.zig 314ms 0.9ms 1.3MB 300ms 0ms zig 0.13.0
cpp 1.cpp 314ms 0.4ms 2.3MB 300ms 0ms clang++ 14.0.0-1ubuntu1.1
c 5.c 315ms 1.9ms 2.3MB 303ms 0ms clang 14.0.0-1ubuntu1.1
c 2.c 316ms 8.2ms 1.5MB 307ms 0ms zigcc 0.13.0
c 2.c 318ms 2.4ms 2.1MB 307ms 0ms clang 14.0.0-1ubuntu1.1
nim 2.nim 320ms 1.8ms 1.8MB 310ms 0ms nim 2.2.0
chapel 2.chpl 328ms 1.8ms 32.8MB 320ms 0ms chpl 1.31.0
c 8-i.c 332ms 0.7ms 2.3MB 320ms 0ms gcc 14.2.0
nim 2.nim 340ms 1.1ms 2.0MB 330ms 0ms nim/clang 2.2.0
crystal 2.cr 342ms 2.6ms 3.4MB 327ms 0ms crystal 1.14.0
swift 7.swift 342ms 0.8ms 9.9MB 330ms 0ms swift 6.0.2
crystal 1.cr 344ms 2.9ms 3.4MB 333ms 0ms crystal 1.14.0
go 1.go 348ms 4.4ms 0.1MB 337ms 0ms tinygo 0.34.0
odin 1.odin 353ms 1.7ms 1.5MB 340ms 0ms odin 2024
odin 1-i.odin 355ms 1.2ms 1.5MB 340ms 0ms odin 2024
csharp 9.cs 358ms 1.2ms 34.0MB 347ms 0ms dotnet 9.0.100
d 2.d 361ms 0.5ms 2.9MB 350ms 0ms ldc2 1.39.0
d 1.d 361ms 1.0ms 2.9MB 350ms 0ms ldc2 1.39.0
go 1.go 362ms 2.1ms 3.4MB 350ms 0ms go 1.23.3
csharp 8.cs 371ms 1.4ms 15.8MB 360ms 0ms dotnet/aot 9.0.100
ocaml 1.ml 372ms 3.2ms 5.3MB 363ms 0ms ocaml 5.2.0
wasm 1.rs 406ms 1.1ms 18.6MB 390ms 0ms wasmtime 25.0.3
kotlin 1n.kt 407ms 3.5ms 4.6MB 397ms 0ms kotlin/native 1.8.21
dart 3.dart 416ms 1.1ms 6.0MB 403ms 0ms dart/exe 3.5.4
csharp 8.cs 424ms 8.4ms 33.8MB 397ms 10ms dotnet 9.0.100
java 1.java 441ms 0.5ms 44.8MB 473ms 17ms openjdk 21
kotlin 1.kt 443ms 2.0ms 49.1MB 483ms 17ms kotlin/jvm 21
java 1.java 443ms 0.5ms 48.2MB 473ms 20ms openjdk 23
java 1.java 448ms 4.1ms 87.2MB 477ms 33ms graal/jvm 17.0.8
javascript 6.js 454ms 4.7ms 59.9MB 437ms 7ms node 23.1.0
typescript 6.ts 464ms 2.6ms 58.5MB 443ms 10ms deno 2.0.6
java 1.java 561ms 5.7ms 44.9MB 477ms 143ms openjdk/zgc 21
wasm 2.rs 578ms 1.2ms 18.6MB 560ms 0ms wasmtime 25.0.3
javascript 6.js 659ms 2.2ms 44.6MB 650ms 7ms bun 1.1.34
d 1.d 680ms 2.2ms 4.6MB 670ms 0ms dmd 2.109.1
lua 4.lua 716ms 7.4ms 2.4MB 707ms 0ms luajit 2.1.0-beta3
ruby 2.rb 836ms 3.2ms 328.9MB 1067ms 113ms truffleruby 24.1.1
haxe 2.hx 855ms 3.4ms 5.1MB 843ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 1054ms 2.8ms 5.0MB 1043ms 0ms haxe/hl/c 4.3.6
java 2.java 1229ms 2.7ms 655.9MB 1363ms 70ms openjdk 21
java 2.java 1235ms 8.6ms 756.2MB 1357ms 87ms openjdk 23
csharp 8.cs 1247ms 5.7ms 24.3MB 1230ms 7ms mono 6.12.0
codon 1.py 1302ms 15ms 7.9MB 1287ms 0ms codon 0.17.0
python 2.py 1351ms 7.9ms 59.8MB 1323ms 17ms pypy 3.10.14
haxe 3.hx 1382ms 7.5ms 27.6MB 1513ms 40ms haxe/cpp 4.3.6
d 2.d 2009ms 2.2ms 4.6MB 2000ms 0ms dmd 2.109.1
haxe 2.hx 2399ms 2.0ms 5.7MB 2390ms 0ms haxe/hl/jit 1.14.0
haxe 1.hx 2449ms 2.4ms 5.7MB 2437ms 0ms haxe/hl/jit 1.14.0
python 1.py 2634ms 23ms 56.6MB 2610ms 10ms pypy 3.10.14
java 2.java 3343ms 165ms 2671.0MB 1647ms 1893ms openjdk/zgc 21
haxe 1.hx timeout 0.0ms 4.4MB 4987ms 0ms haxe/cpp 4.3.6
haxe 2.hx timeout 0.0ms 4.4MB 4990ms 0ms haxe/cpp 4.3.6
haxe 3.hx timeout 0.0ms 5.2MB 3810ms 1693ms haxe/hl/c 4.3.6
haxe 3.hx timeout 0.0ms 5.9MB 4037ms 1417ms haxe/hl/jit 1.14.0
lua 4.lua timeout 0.0ms 2.3MB 4990ms 0ms lua 5.4.7
perl 2.pl timeout 0.0ms 6.3MB 4990ms 0ms perl 5.40.0
python 1.py timeout 0.0ms 8.8MB 4987ms 3ms cpython 3.13.0
python 2.py timeout 0.0ms 8.8MB 4990ms 0ms cpython 3.13.0
python 1.py timeout 0.0ms 8.3MB 4987ms 3ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4987ms 0ms pyston 3.8.12
ruby 2.rb timeout 0.0ms 28.1MB 4973ms 13ms ruby 3.3.6
ruby 2.rb timeout 0.0ms 28.1MB 4973ms 17ms ruby/yjit 3.3.6

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
cpp 0-i.cpp 18ms 0.1ms 1.5MB 10ms 0ms g++ 11.4.0
rust 4-i.rs 19ms 0.2ms 1.8MB 10ms 0ms rustc 1.82.0
cpp 0-i.cpp 19ms 0.1ms 2.3MB 10ms 0ms clang++ 14.0.0-1ubuntu1.1
rust 7-i.rs 26ms 0.3ms 1.9MB 17ms 0ms rustc 1.82.0
rust 1.rs 26ms 0.3ms 1.8MB 20ms 0ms rustc 1.82.0
c 8-i.c 27ms 0.4ms 1.5MB 20ms 0ms zigcc 0.13.0
rust 3.rs 30ms 0.1ms 1.9MB 20ms 0ms rustc 1.84.0-nightly
zig 2.zig 30ms 1.5ms 1.1MB 20ms 0ms zig 0.13.0
rust 2.rs 30ms 0.0ms 1.8MB 20ms 0ms rustc 1.82.0
c 5.c 32ms 0.2ms 1.5MB 20ms 0ms zigcc 0.13.0
c 8-i.c 33ms 0.3ms 2.1MB 20ms 0ms clang 14.0.0-1ubuntu1.1
v 1.v 33ms 0.3ms 1.6MB 23ms 0ms v/clang 0.4.8
c 5.c 34ms 0.4ms 2.3MB 27ms 0ms gcc 14.2.0
v 1.v 34ms 0.2ms 2.4MB 20ms 0ms v/clang+gc 0.4.8
zig 1.zig 34ms 0.6ms 1.3MB 23ms 0ms zig 0.13.0
c 2.c 34ms 0.1ms 2.3MB 27ms 0ms gcc 14.2.0
c 2.c 34ms 0.8ms 1.5MB 23ms 0ms zigcc 0.13.0
cpp 1.cpp 34ms 0.8ms 1.8MB 23ms 0ms g++ 11.4.0
cpp 1.cpp 34ms 0.5ms 2.3MB 27ms 0ms clang++ 14.0.0-1ubuntu1.1
nim 2.nim 35ms 1.2ms 1.8MB 27ms 0ms nim 2.2.0
c 5.c 35ms 0.5ms 2.1MB 30ms 0ms clang 14.0.0-1ubuntu1.1
c 2.c 35ms 0.2ms 2.1MB 23ms 0ms clang 14.0.0-1ubuntu1.1
c 8-i.c 36ms 0.1ms 2.3MB 30ms 0ms gcc 14.2.0
nim 2.nim 37ms 1.1ms 2.0MB 30ms 0ms nim/clang 2.2.0
go 1.go 37ms 1.4ms 2.1MB 30ms 0ms tinygo 0.34.0
odin 1.odin 37ms 0.5ms 1.5MB 27ms 0ms odin 2024
crystal 1.cr 38ms 0.2ms 3.4MB 27ms 0ms crystal 1.14.0
odin 1-i.odin 38ms 0.6ms 1.5MB 30ms 0ms odin 2024
crystal 2.cr 39ms 0.3ms 3.4MB 30ms 0ms crystal 1.14.0
d 1.d 39ms 0.5ms 2.9MB 30ms 0ms ldc2 1.39.0
d 2.d 39ms 0.7ms 2.9MB 30ms 0ms ldc2 1.39.0
ocaml 1.ml 40ms 0.1ms 5.3MB 30ms 0ms ocaml 5.2.0
swift 7.swift 40ms 0.7ms 10.1MB 30ms 0ms swift 6.0.2
go 1.go 40ms 0.4ms 3.4MB 30ms 0ms go 1.23.3
kotlin 1n.kt 45ms 1.6ms 4.6MB 33ms 0ms kotlin/native 1.8.21
csharp 8.cs 45ms 1.6ms 15.8MB 30ms 0ms dotnet/aot 9.0.100
dart 3.dart 49ms 1.4ms 6.1MB 40ms 0ms dart/exe 3.5.4
wasm 1.rs 49ms 0.5ms 18.6MB 33ms 0ms wasmtime 25.0.3
chapel 2.chpl 52ms 0.1ms 32.9MB 37ms 7ms chpl 1.31.0
wasm 2.rs 66ms 1.1ms 18.6MB 50ms 0ms wasmtime 25.0.3
d 1.d 71ms 0.9ms 4.8MB 63ms 0ms dmd 2.109.1
lua 4.lua 76ms 2.2ms 2.4MB 67ms 0ms luajit 2.1.0-beta3
javascript 6.js 77ms 1.1ms 60.1MB 70ms 3ms node 23.1.0
javascript 6.js 85ms 1.3ms 44.8MB 77ms 3ms bun 1.1.34
haxe 2.hx 90ms 1.1ms 5.0MB 80ms 0ms haxe/hl/c 4.3.6
csharp 9.cs 93ms 1.7ms 33.7MB 77ms 7ms dotnet 9.0.100
csharp 8.cs 94ms 0.7ms 33.7MB 73ms 10ms dotnet 9.0.100
typescript 6.ts 105ms 23ms 57.3MB 87ms 10ms deno 2.0.6
haxe 1.hx 111ms 3.0ms 5.1MB 100ms 0ms haxe/hl/c 4.3.6
java 1.java 112ms 4.9ms 45.5MB 147ms 13ms openjdk 21
kotlin 1.kt 118ms 1.0ms 49.6MB 160ms 17ms kotlin/jvm 21
java 1.java 119ms 3.9ms 47.9MB 147ms 20ms openjdk 23
java 1.java 124ms 8.9ms 87.2MB 153ms 30ms graal/jvm 17.0.8
codon 1.py 136ms 1.4ms 7.9MB 130ms 0ms codon 0.17.0
haxe 3.hx 153ms 1.3ms 27.8MB 150ms 7ms haxe/cpp 4.3.6
csharp 8.cs 165ms 1.7ms 24.4MB 150ms 0ms mono 6.12.0
python 2.py 176ms 1.4ms 57.6MB 147ms 13ms pypy 3.10.14
d 2.d 203ms 0.2ms 4.6MB 190ms 0ms dmd 2.109.1
java 1.java 239ms 6.7ms 46.6MB 147ms 147ms openjdk/zgc 21
haxe 2.hx 245ms 1.9ms 5.7MB 233ms 0ms haxe/hl/jit 1.14.0
haxe 1.hx 252ms 3.5ms 5.7MB 240ms 0ms haxe/hl/jit 1.14.0
java 2-m.java 296ms 11ms 364.7MB 430ms 60ms openjdk 21
python 1.py 301ms 4.2ms 56.6MB 273ms 10ms pypy 3.10.14
java 2-m.java 307ms 7.8ms 389.9MB 443ms 60ms openjdk 23
ruby 2-m.rb 320ms 5.4ms 323.3MB 570ms 93ms truffleruby 24.1.1
haxe 3.hx 664ms 1.7ms 5.1MB 520ms 197ms haxe/hl/c 4.3.6
haxe 2.hx 672ms 7.7ms 4.4MB 660ms 0ms haxe/cpp 4.3.6
java 2.java 699ms 7.2ms 532.4MB 463ms 420ms openjdk/zgc 21
haxe 3.hx 776ms 1.7ms 5.8MB 633ms 203ms haxe/hl/jit 1.14.0
haxe 1.hx 809ms 4.9ms 4.4MB 797ms 0ms haxe/cpp 4.3.6
python 1.py 926ms 8.6ms 8.3MB 910ms 0ms pyston 3.8.12
lua 4.lua 1120ms 22ms 2.3MB 1107ms 0ms lua 5.4.7
python 2.py 1297ms 12ms 8.1MB 1280ms 0ms pyston 3.8.12
ruby 2.rb 1451ms 4.2ms 28.3MB 1407ms 27ms ruby/yjit 3.3.6
perl 2.pl 2722ms 8.2ms 6.1MB 2710ms 0ms perl 5.40.0
ruby 2.rb 2876ms 55ms 28.0MB 2843ms 13ms ruby 3.3.6
python 1.py 3025ms 45ms 8.8MB 3007ms 3ms cpython 3.13.0
python 2.py 3179ms 124ms 8.8MB 3167ms 0ms cpython 3.13.0