V VS Kotlin benchmarks

Current benchmark data was generated on Mon Jun 23 2025, 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.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt 502ms 3.0ms 581.8MB 603ms 93ms kotlin/jvm 21
v 1.v 864ms 25ms 28.9MB 853ms 0ms v/clang+gc 0.4.11
v 1.v 2188ms 3.5ms 2086.6MB 1307ms 867ms v/clang 0.4.11
kotlin 1.kt 4205ms 55ms 144.8MB 4410ms 63ms kotlin/native 2.1.20

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 71ms 0.8ms 4.6MB 60ms 0ms v/clang+gc 0.4.11
kotlin 1.kt 121ms 3.5ms 163.1MB 150ms 30ms kotlin/jvm 21
v 1.v 205ms 4.7ms 198.0MB 110ms 83ms v/clang 0.4.11
kotlin 1.kt 219ms 14ms 17.7MB 223ms 7ms kotlin/native 2.1.20

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 2-m.kt 1914ms 60ms 234.2MB 7147ms 110ms kotlin/jvm 21
kotlin 1.kt 2192ms 8.0ms 218.7MB 3023ms 70ms kotlin/jvm 21
kotlin 2-m.kt 4300ms 30ms 21.1MB 14380ms 537ms kotlin/native 2.1.20
kotlin 1.kt timeout 0.0ms 17.4MB 5517ms 30ms kotlin/native 2.1.20
v 1.v timeout 0.0ms 17.5MB 8343ms 10803ms v/clang 0.4.11
v 1.v timeout 0.0ms 17.6MB 8653ms 10620ms v/clang+gc 0.4.11

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 2-m.kt 249ms 2.2ms 21.4MB 840ms 40ms kotlin/native 2.1.20
kotlin 1.kt 389ms 6.7ms 17.4MB 397ms 7ms kotlin/native 2.1.20
kotlin 1-m.kt 482ms 16ms 75.4MB 1090ms 40ms kotlin/jvm 21
kotlin 2-m.kt 814ms 72ms 95.6MB 2813ms 77ms kotlin/jvm 21
v 1-m.v 1345ms 36ms 9.8MB 2223ms 2887ms v/clang 0.4.11
v 1-m.v 1657ms 68ms 10.4MB 2843ms 3423ms v/clang+gc 0.4.11

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 8.1MB 4990ms 0ms v/clang+gc 0.4.11

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 4.5MB 4990ms 0ms v/clang+gc 0.4.11

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 2201ms 5.0ms 1.9MB 2193ms 0ms v/clang+gc 0.4.11
v 1.v 2314ms 97ms 1.1MB 2307ms 0ms v/clang 0.4.11

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 188ms 2.1ms 1.9MB 180ms 0ms v/clang+gc 0.4.11
v 1.v 193ms 1.7ms 1.1MB 183ms 0ms v/clang 0.4.11

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 505ms 3.4ms 1.3MB 497ms 0ms v/clang 0.4.11
v 1.v 528ms 4.5ms 2.1MB 513ms 0ms v/clang+gc 0.4.11

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 53ms 0.7ms 1.3MB 47ms 0ms v/clang 0.4.11
v 1.v 56ms 2.1ms 2.1MB 50ms 0ms v/clang+gc 0.4.11

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1.0ms 0.0ms 1.4MB 0ms 0ms v/clang 0.4.11
v 1.v 1.3ms 0.1ms 1.9MB 0ms 0ms v/clang+gc 0.4.11
kotlin 1.kt 2.1ms 0.1ms 3.0MB 0ms 0ms kotlin/native 2.1.20
kotlin 1-m.kt 62ms 0.8ms 47.8MB 78ms 18ms kotlin/jvm 21

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 2.kt 166ms 1.9ms 12.4MB 167ms 0ms kotlin/native 2.1.20
kotlin 1-m.kt 197ms 7.4ms 94.7MB 323ms 30ms kotlin/jvm 21
kotlin 2-m.kt 201ms 1.6ms 102.7MB 457ms 37ms kotlin/jvm 21
v 1.v 262ms 4.6ms 2.1MB 253ms 0ms v/clang+gc 0.4.11
v 1.v 266ms 2.4ms 1.3MB 260ms 0ms v/clang 0.4.11
kotlin 1.kt 375ms 17ms 12.4MB 380ms 0ms kotlin/native 2.1.20

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 2-m.kt 317ms 2.5ms 210.7MB 540ms 50ms kotlin/jvm 21
kotlin 1.kt 341ms 2.0ms 203.0MB 457ms 40ms kotlin/jvm 21
kotlin 2.kt 475ms 2.5ms 12.5MB 503ms 0ms kotlin/native 2.1.20
v 1.v 771ms 2.0ms 2.1MB 760ms 0ms v/clang+gc 0.4.11
v 1.v 789ms 22ms 1.3MB 780ms 0ms v/clang 0.4.11
kotlin 1.kt 1046ms 1.8ms 12.5MB 1073ms 3ms kotlin/native 2.1.20

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 91ms 1.3ms 1.3MB 83ms 0ms v/clang 0.4.11
kotlin 2.kt 95ms 0.1ms 12.8MB 87ms 0ms kotlin/native 2.1.20
v 1.v 103ms 2.6ms 2.1MB 97ms 0ms v/clang+gc 0.4.11
kotlin 1.kt 122ms 1.1ms 12.8MB 117ms 0ms kotlin/native 2.1.20
kotlin 1-m.kt 153ms 4.0ms 92.4MB 293ms 27ms kotlin/jvm 21
kotlin 2-m.kt 170ms 16ms 95.9MB 367ms 37ms kotlin/jvm 21

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 312ms 1.0ms 2.3MB 300ms 0ms v/clang+gc 0.4.11
v 1.v 312ms 2.1ms 1.6MB 300ms 0ms v/clang 0.4.11
kotlin 1n.kt 354ms 2.9ms 3.6MB 343ms 0ms kotlin/native 2.1.20
kotlin 1.kt 444ms 1.3ms 49.7MB 487ms 20ms kotlin/jvm 21

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 33ms 0.1ms 2.3MB 20ms 0ms v/clang+gc 0.4.11
v 1.v 34ms 1.0ms 1.6MB 27ms 0ms v/clang 0.4.11
kotlin 1n.kt 40ms 1.0ms 3.5MB 30ms 0ms kotlin/native 2.1.20
kotlin 1-m.kt 121ms 1.7ms 49.7MB 167ms 17ms kotlin/jvm 21

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 329ms 14ms 40.3MB 313ms 0ms v/clang 0.4.11
v 2.v 330ms 2.6ms 6.1MB 320ms 0ms v/clang 0.4.11
v 2.v 330ms 5.1ms 6.9MB 320ms 0ms v/clang+gc 0.4.11
v 1.v 447ms 7.3ms 60.6MB 430ms 0ms v/clang+gc 0.4.11

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 61ms 2.0ms 11.1MB 50ms 0ms v/clang 0.4.11
v 1.v 62ms 2.1ms 11.9MB 50ms 0ms v/clang+gc 0.4.11
v 2.v 82ms 2.0ms 2.4MB 73ms 0ms v/clang 0.4.11
v 2.v 83ms 1.6ms 3.1MB 70ms 0ms v/clang+gc 0.4.11

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 2.v 3216ms 15ms 3.5MB 3197ms 7ms v/clang+gc 0.4.11
kotlin 1.kt 3774ms 15ms 353.5MB 4633ms 110ms kotlin/jvm 21
kotlin 1n.kt timeout 0.0ms 26.6MB 4053ms 1487ms kotlin/native 2.1.20
kotlin 2n.kt timeout 0.0ms 30.6MB 5113ms 140ms kotlin/native 2.1.20

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 2.v 801ms 11ms 3.1MB 790ms 0ms v/clang+gc 0.4.11
kotlin 1-m.kt 1024ms 7.6ms 352.8MB 1743ms 87ms kotlin/jvm 21
kotlin 1n.kt timeout 0.0ms 26.9MB 4010ms 1517ms kotlin/native 2.1.20
kotlin 2n.kt timeout 0.0ms 30.7MB 5123ms 140ms kotlin/native 2.1.20

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt timeout 0.0ms 173.5MB 5417ms 50ms kotlin/jvm 21
kotlin 1n.kt timeout 0.0ms 226.8MB 5067ms 120ms kotlin/native 2.1.20
v 1.v timeout 0.0ms 83.1MB 4980ms 10ms v/clang+gc 0.4.11

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1-m.kt 828ms 9.1ms 134.4MB 1267ms 40ms kotlin/jvm 21
kotlin 1n.kt 3234ms 34ms 51.1MB 3313ms 80ms kotlin/native 2.1.20
v 1.v 3540ms 93ms 26.0MB 3523ms 3ms v/clang+gc 0.4.11

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v timeout 0.0ms 1.6MB 4990ms 0ms v/clang 0.4.11
v 1.v timeout 0.0ms 2.8MB 4990ms 0ms v/clang+gc 0.4.11

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1286ms 8.5ms 1.5MB 1277ms 0ms v/clang 0.4.11
v 1.v 1326ms 6.9ms 2.5MB 1313ms 0ms v/clang+gc 0.4.11

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 326ms 0.7ms 1.9MB 320ms 0ms v/clang 0.4.11
v 1.v 334ms 0.7ms 2.5MB 320ms 0ms v/clang+gc 0.4.11