All nbody problem benchmarks

Current benchmark data was generated on Mon Dec 30 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
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 4-i.rs 180ms 29ms 1.8MB 170ms 0ms rustc 1.83.0
rust 7-i.rs 236ms 1.2ms 1.8MB 223ms 0ms rustc 1.83.0
rust 1.rs 238ms 0.9ms 1.8MB 230ms 0ms rustc 1.83.0
c 8-i.c 246ms 1.1ms 1.5MB 233ms 0ms zigcc 0.13.0
zig 2.zig 273ms 0.3ms 1.1MB 260ms 0ms zig 0.13.0
rust 2.rs 278ms 0.4ms 1.8MB 270ms 0ms rustc 1.83.0
rust 3.rs 280ms 0.1ms 1.9MB 270ms 0ms rustc 1.85.0-nightly
c 5.c 298ms 0.5ms 1.5MB 290ms 0ms zigcc 0.13.0
c 8-i.c 300ms 0.7ms 2.1MB 290ms 0ms clang 14.0.0-1ubuntu1.1
v 1.v 309ms 0.5ms 1.6MB 300ms 0ms v/clang 0.4.9
c 2.c 309ms 1.2ms 2.3MB 300ms 0ms gcc 14.2.0
c 2.c 311ms 1.6ms 1.5MB 300ms 0ms zigcc 0.13.0
v 1.v 311ms 1.8ms 2.3MB 300ms 0ms v/clang+gc 0.4.9
c 5.c 311ms 0.5ms 2.3MB 300ms 0ms gcc 14.2.0
zig 1.zig 313ms 1.5ms 1.3MB 300ms 0ms zig 0.13.0
cpp 1.cpp 313ms 1.5ms 2.3MB 303ms 0ms clang++ 14.0.0-1ubuntu1.1
c 5.c 314ms 1.7ms 2.1MB 310ms 0ms clang 14.0.0-1ubuntu1.1
cpp 1.cpp 315ms 1.9ms 1.8MB 303ms 0ms g++ 11.4.0
nim 2.nim 319ms 1.8ms 1.8MB 310ms 0ms nim 2.2.0
c 2.c 325ms 14ms 2.1MB 313ms 0ms clang 14.0.0-1ubuntu1.1
chapel 2.chpl 329ms 2.7ms 32.9MB 317ms 3ms chpl 1.31.0
c 8-i.c 332ms 1.3ms 2.3MB 320ms 0ms gcc 14.2.0
crystal 2.cr 341ms 1.2ms 3.4MB 330ms 0ms crystal 1.14.0
nim 2.nim 342ms 2.3ms 2.0MB 327ms 0ms nim/clang 2.2.0
crystal 1.cr 343ms 3.1ms 3.4MB 333ms 0ms crystal 1.14.0
swift 7.swift 343ms 2.3ms 9.8MB 333ms 0ms swift 6.0.3
go 1.go 348ms 0.7ms 0.1MB 340ms 0ms tinygo 0.35.0
odin 1.odin 354ms 2.1ms 1.5MB 343ms 0ms odin 2024
odin 1-i.odin 356ms 0.9ms 1.5MB 343ms 0ms odin 2024
d 1.d 359ms 0.2ms 2.9MB 347ms 0ms ldc2 1.40.0
csharp 9.cs 359ms 1.6ms 34.0MB 337ms 7ms dotnet 9.0.101
d 2.d 359ms 1.7ms 2.9MB 350ms 0ms ldc2 1.40.0
go 1.go 363ms 3.4ms 3.4MB 350ms 0ms go 1.23.4
csharp 8.cs 373ms 3.9ms 15.7MB 357ms 0ms dotnet/aot 9.0.101
ocaml 1.ml 379ms 2.6ms 5.2MB 367ms 0ms ocaml 5.2.1
wasm 1.rs 399ms 1.0ms 20.8MB 387ms 0ms wasmtime 28.0.0
dart 3.dart 408ms 1.4ms 6.3MB 393ms 0ms dart/exe 3.6.0
kotlin 1n.kt 411ms 9.2ms 4.6MB 397ms 0ms kotlin/native 1.8.21
csharp 8.cs 426ms 13ms 33.8MB 390ms 13ms dotnet 9.0.101
java 1.java 440ms 1.4ms 45.1MB 480ms 17ms openjdk 21
kotlin 1.kt 441ms 0.6ms 49.2MB 487ms 13ms kotlin/jvm 21
java 1.java 442ms 1.9ms 48.1MB 480ms 10ms openjdk 23
java 1.java 448ms 9.7ms 84.8MB 477ms 23ms graal/jvm 17.0.8
javascript 6.js 455ms 3.5ms 59.6MB 440ms 7ms node 23.5.0
typescript 6.ts 465ms 1.7ms 58.1MB 453ms 3ms deno 2.1.4
java 1.java 564ms 1.4ms 44.6MB 477ms 143ms openjdk/zgc 21
wasm 2.rs 576ms 0.3ms 18.8MB 563ms 0ms wasmtime 28.0.0
javascript 6.js 659ms 1.5ms 44.6MB 657ms 7ms bun 1.1.42
d 1.d 678ms 2.0ms 4.6MB 670ms 0ms dmd 2.109.1
lua 4.lua 709ms 2.8ms 2.3MB 700ms 0ms luajit 2.1.0-beta3
ruby 2.rb 835ms 6.7ms 327.0MB 1073ms 117ms truffleruby 24.1.1
haxe 2.hx 853ms 4.3ms 5.0MB 843ms 0ms haxe/hl/c 4.3.6
haxe 1.hx 1056ms 20ms 5.0MB 1047ms 0ms haxe/hl/c 4.3.6
java 2.java 1225ms 6.3ms 537.4MB 1353ms 73ms openjdk 21
csharp 8.cs 1248ms 3.3ms 24.1MB 1237ms 0ms mono 6.12.0
java 2.java 1260ms 20ms 715.9MB 1367ms 110ms openjdk 23
codon 1.py 1295ms 2.7ms 7.7MB 1280ms 0ms codon 0.17.0
python 2.py 1353ms 12ms 59.9MB 1337ms 3ms pypy 3.10.14
haxe 3.hx 1383ms 5.0ms 27.5MB 1513ms 37ms haxe/cpp 4.3.6
d 2.d 2007ms 1.9ms 4.6MB 1997ms 0ms dmd 2.109.1
haxe 2.hx 2402ms 1.6ms 5.8MB 2390ms 0ms haxe/hl/jit 1.14.0
haxe 1.hx 2449ms 4.0ms 5.8MB 2437ms 0ms haxe/hl/jit 1.14.0
python 1.py 2633ms 14ms 56.6MB 2607ms 13ms pypy 3.10.14
java 2.java 3206ms 52ms 2355.0MB 1643ms 1770ms openjdk/zgc 21
haxe 1.hx timeout 0.0ms 4.4MB 4990ms 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.3MB 3917ms 1587ms haxe/hl/c 4.3.6
haxe 3.hx timeout 0.0ms 6.0MB 4130ms 1333ms 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.1MB 4990ms 0ms perl 5.40.0
python 1.py timeout 0.0ms 8.6MB 4990ms 0ms cpython 3.13.1
python 2.py timeout 0.0ms 8.8MB 4987ms 0ms cpython 3.13.1
python 1.py timeout 0.0ms 8.3MB 4983ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4983ms 0ms pyston 3.8.12
ruby 2.rb timeout 0.0ms 12.9MB 4980ms 3ms ruby 3.4.1
ruby 2.rb timeout 0.0ms 13.6MB 4980ms 3ms ruby/yjit 3.4.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
rust 4-i.rs 18ms 0.1ms 1.8MB 10ms 0ms rustc 1.83.0
cpp 0-i.cpp 18ms 0.1ms 1.5MB 10ms 0ms g++ 11.4.0
cpp 0-i.cpp 19ms 0.1ms 2.3MB 10ms 0ms clang++ 14.0.0-1ubuntu1.1
rust 7-i.rs 26ms 0.2ms 1.8MB 17ms 0ms rustc 1.83.0
rust 1.rs 26ms 0.3ms 1.8MB 17ms 0ms rustc 1.83.0
c 8-i.c 27ms 0.5ms 1.5MB 20ms 0ms zigcc 0.13.0
zig 2.zig 29ms 0.0ms 1.1MB 20ms 0ms zig 0.13.0
rust 2.rs 30ms 0.2ms 1.8MB 20ms 0ms rustc 1.83.0
rust 3.rs 30ms 0.2ms 1.8MB 20ms 0ms rustc 1.85.0-nightly
c 5.c 32ms 0.4ms 1.5MB 20ms 0ms zigcc 0.13.0
c 8-i.c 33ms 0.6ms 2.1MB 23ms 0ms clang 14.0.0-1ubuntu1.1
c 5.c 33ms 0.0ms 2.3MB 27ms 0ms gcc 14.2.0
v 1.v 33ms 0.0ms 1.6MB 23ms 0ms v/clang 0.4.9
c 2.c 33ms 0.4ms 2.3MB 23ms 0ms gcc 14.2.0
v 1.v 33ms 0.7ms 2.3MB 23ms 0ms v/clang+gc 0.4.9
c 2.c 34ms 0.3ms 1.5MB 27ms 0ms zigcc 0.13.0
cpp 1.cpp 34ms 0.6ms 2.3MB 27ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1.cpp 34ms 0.8ms 1.8MB 20ms 0ms g++ 11.4.0
c 5.c 34ms 0.5ms 2.1MB 23ms 0ms clang 14.0.0-1ubuntu1.1
zig 1.zig 34ms 0.4ms 1.3MB 27ms 0ms zig 0.13.0
nim 2.nim 35ms 0.9ms 1.8MB 23ms 0ms nim 2.2.0
c 8-i.c 35ms 0.1ms 2.3MB 27ms 0ms gcc 14.2.0
c 2.c 35ms 1.7ms 2.1MB 23ms 0ms clang 14.0.0-1ubuntu1.1
go 1.go 36ms 0.1ms 2.1MB 30ms 0ms tinygo 0.35.0
nim 2.nim 36ms 0.3ms 2.0MB 30ms 0ms nim/clang 2.2.0
crystal 2.cr 37ms 0.3ms 3.4MB 30ms 0ms crystal 1.14.0
odin 1.odin 37ms 0.5ms 1.5MB 30ms 0ms odin 2024
crystal 1.cr 37ms 0.7ms 3.4MB 30ms 0ms crystal 1.14.0
d 1.d 38ms 0.3ms 2.9MB 30ms 0ms ldc2 1.40.0
swift 7.swift 39ms 0.2ms 9.8MB 27ms 0ms swift 6.0.3
odin 1-i.odin 39ms 1.4ms 1.5MB 30ms 0ms odin 2024
d 2.d 39ms 0.4ms 2.9MB 30ms 0ms ldc2 1.40.0
go 1.go 40ms 1.0ms 3.4MB 30ms 0ms go 1.23.4
ocaml 1.ml 41ms 1.6ms 5.3MB 30ms 0ms ocaml 5.2.1
kotlin 1n.kt 43ms 1.1ms 4.6MB 33ms 0ms kotlin/native 1.8.21
dart 3.dart 46ms 1.0ms 6.1MB 37ms 0ms dart/exe 3.6.0
csharp 8.cs 46ms 0.6ms 15.9MB 33ms 0ms dotnet/aot 9.0.101
wasm 1.rs 47ms 0.6ms 19.0MB 40ms 0ms wasmtime 28.0.0
chapel 2.chpl 51ms 0.3ms 32.8MB 40ms 3ms chpl 1.31.0
wasm 2.rs 66ms 0.7ms 18.8MB 57ms 0ms wasmtime 28.0.0
d 1.d 71ms 0.4ms 4.6MB 60ms 0ms dmd 2.109.1
javascript 6.js 76ms 0.7ms 59.8MB 63ms 7ms node 23.5.0
lua 4.lua 76ms 2.9ms 2.3MB 70ms 0ms luajit 2.1.0-beta3
typescript 6.ts 78ms 1.9ms 58.8MB 60ms 13ms deno 2.1.4
javascript 6.js 87ms 0.3ms 44.6MB 77ms 7ms bun 1.1.42
haxe 2.hx 89ms 1.1ms 5.0MB 80ms 0ms haxe/hl/c 4.3.6
csharp 9.cs 91ms 0.7ms 33.8MB 70ms 10ms dotnet 9.0.101
csharp 8.cs 104ms 17ms 33.7MB 73ms 7ms dotnet 9.0.101
haxe 1.hx 109ms 1.4ms 5.0MB 100ms 0ms haxe/hl/c 4.3.6
kotlin 1-m.kt 118ms 1.0ms 49.4MB 167ms 13ms kotlin/jvm 21
java 1.java 118ms 1.6ms 45.3MB 157ms 17ms openjdk 21
java 1.java 122ms 0.2ms 48.4MB 160ms 10ms openjdk 23
java 1-m.java 122ms 5.7ms 95.3MB 160ms 30ms graal/jvm 17.0.8
codon 1.py 141ms 10ms 8.0MB 133ms 0ms codon 0.17.0
haxe 3.hx 153ms 1.0ms 25.6MB 147ms 13ms haxe/cpp 4.3.6
csharp 8.cs 161ms 1.4ms 22.5MB 147ms 3ms mono 6.12.0
python 2.py 177ms 3.9ms 57.6MB 153ms 10ms pypy 3.10.14
d 2.d 205ms 1.6ms 4.6MB 193ms 0ms dmd 2.109.1
haxe 2.hx 244ms 0.6ms 5.8MB 230ms 0ms haxe/hl/jit 1.14.0
java 1.java 245ms 1.2ms 44.5MB 160ms 143ms openjdk/zgc 21
haxe 1.hx 251ms 2.9ms 5.7MB 240ms 0ms haxe/hl/jit 1.14.0
java 2-m.java 296ms 5.5ms 346.7MB 430ms 57ms openjdk 21
java 2-m.java 298ms 3.8ms 394.1MB 427ms 70ms openjdk 23
python 1.py 305ms 2.4ms 56.6MB 283ms 7ms pypy 3.10.14
ruby 2-m.rb 322ms 4.0ms 333.7MB 590ms 100ms truffleruby 24.1.1
haxe 3.hx 662ms 6.0ms 5.3MB 483ms 237ms haxe/hl/c 4.3.6
haxe 2.hx 675ms 7.4ms 4.4MB 663ms 0ms haxe/cpp 4.3.6
java 2.java 682ms 11ms 527.4MB 467ms 393ms openjdk/zgc 21
haxe 3.hx 772ms 2.9ms 5.8MB 617ms 210ms haxe/hl/jit 1.14.0
haxe 1.hx 805ms 6.0ms 4.4MB 793ms 0ms haxe/cpp 4.3.6
python 1.py 946ms 19ms 8.3MB 937ms 0ms pyston 3.8.12
ruby 2.rb 1053ms 5.8ms 13.6MB 1037ms 3ms ruby/yjit 3.4.1
lua 4.lua 1160ms 19ms 2.3MB 1147ms 0ms lua 5.4.7
python 2.py 1298ms 20ms 8.1MB 1280ms 0ms pyston 3.8.12
perl 2.pl 2734ms 15ms 6.1MB 2720ms 0ms perl 5.40.0
ruby 2.rb 2816ms 74ms 12.9MB 2800ms 3ms ruby 3.4.1
python 1.py 2997ms 82ms 8.8MB 2987ms 0ms cpython 3.13.1
python 2.py 3190ms 235ms 8.8MB 3177ms 0ms cpython 3.13.1