V VS Typescript benchmarks

Current benchmark data was generated on Sat Jan 28 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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
v 1.v 1286ms 4.6ms 37.1MB 1260ms 13ms v/clang+gc 0.3.2
v 1.v 1296ms 49ms 37.2MB 1277ms 3ms v/clang 0.3.2
typescript 1.ts 3700ms 53ms 146.4MB 3693ms 640ms deno 1.30.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 94ms 1.4ms 5.6MB 83ms 0ms v/clang+gc 0.3.2
v 1.v 95ms 1.3ms 5.5MB 83ms 0ms v/clang 0.3.2
typescript 1.ts 162ms 14ms 56.8MB 180ms 7ms deno 1.30.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 2077ms 16ms 70.6MB 2093ms 27ms deno 1.30.0
v 1.v timeout 0.0ms 16.6MB 5250ms 4327ms v/clang 0.3.2
v 1.v timeout 0.0ms 21.1MB 5033ms 4270ms v/clang+gc 0.3.2

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 172ms 1.4ms 45.2MB 153ms 10ms deno 1.30.0
v 1-m.v 3602ms 203ms 24.5MB 3690ms 3160ms v/clang+gc 0.3.2
v 1-m.v 3937ms 909ms 16.5MB 3953ms 3430ms v/clang 0.3.2

edigits

Input: 250001

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

Input: 100000

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

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 3313ms 2.1ms 2.0MB 3297ms 0ms v/clang+gc 0.3.2
v 1.v 3325ms 8.4ms 2.0MB 3310ms 0ms v/clang 0.3.2

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 280ms 0.9ms 2.0MB 270ms 0ms v/clang 0.3.2
v 1.v 289ms 14ms 2.0MB 273ms 0ms v/clang+gc 0.3.2

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 651ms 2.0ms 2.0MB 633ms 0ms v/clang+gc 0.3.2
v 1.v 653ms 3.2ms 2.0MB 637ms 0ms v/clang 0.3.2
typescript 1.ts 2077ms 51ms 38.6MB 1960ms 103ms deno 1.30.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 68ms 0.6ms 2.0MB 60ms 0ms v/clang+gc 0.3.2
v 1.v 70ms 1.7ms 2.1MB 60ms 0ms v/clang 0.3.2
typescript 1.ts 278ms 20ms 38.4MB 230ms 17ms deno 1.30.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 1.8ms 0.6ms 2.0MB 0ms 0ms v/clang+gc 0.3.2
v 1.v 1.8ms 0.6ms 2.1MB 0ms 0ms v/clang 0.3.2
typescript 1.ts 26ms 1.0ms 32.4MB 10ms 2ms deno 1.30.0

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 2.ts 1119ms 46ms 136.3MB 1230ms 303ms deno 1.30.0
typescript 1.ts 1130ms 33ms 133.9MB 1287ms 310ms deno 1.30.0
typescript 2-tls.ts 1284ms 3.1ms 143.8MB 1423ms 327ms deno 1.30.0
typescript 1-http2.ts 1346ms 27ms 138.9MB 1477ms 360ms deno 1.30.0
v 1.v timeout 0.0ms 9.5MB 537ms 797ms v/clang+gc 0.3.2

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 193ms 38ms 14.8MB 87ms 80ms v/clang+gc 0.3.2
typescript 2.ts 217ms 3.7ms 72.3MB 133ms 70ms deno 1.30.0
typescript 1.ts 232ms 6.3ms 73.5MB 150ms 60ms deno 1.30.0
typescript 1-http2.ts 265ms 12ms 67.4MB 197ms 57ms deno 1.30.0
typescript 2-tls.ts 406ms 12ms 77.7MB 310ms 80ms deno 1.30.0

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 2.ts 364ms 2.2ms 43.5MB 357ms 10ms deno 1.30.0
v 1.v 403ms 1.5ms 2.2MB 390ms 0ms v/clang+gc 0.3.2
v 1.v 424ms 0.3ms 2.2MB 410ms 0ms v/clang 0.3.2
typescript 1.ts 770ms 0.8ms 43.9MB 760ms 3ms deno 1.30.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 2.ts 999ms 4.7ms 45.3MB 990ms 10ms deno 1.30.0
v 1.v 1205ms 2.4ms 2.3MB 1193ms 0ms v/clang+gc 0.3.2
v 1.v 1265ms 1.6ms 2.3MB 1257ms 0ms v/clang 0.3.2
typescript 1.ts 2233ms 2.2ms 45.3MB 2217ms 10ms deno 1.30.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 134ms 1.0ms 2.3MB 123ms 0ms v/clang+gc 0.3.2
v 1.v 140ms 0.3ms 2.3MB 130ms 0ms v/clang 0.3.2
typescript 2.ts 186ms 0.6ms 39.3MB 177ms 7ms deno 1.30.0
typescript 1.ts 213ms 2.8ms 39.7MB 200ms 3ms deno 1.30.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 6.ts 647ms 1.6ms 36.7MB 637ms 3ms deno 1.30.0
v 1.v 871ms 0.8ms 2.3MB 860ms 0ms v/clang 0.3.2
v 1.v 879ms 6.2ms 2.3MB 863ms 0ms v/clang+gc 0.3.2

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 90ms 0.2ms 2.3MB 80ms 0ms v/clang+gc 0.3.2
v 1.v 91ms 1.3ms 2.3MB 80ms 0ms v/clang 0.3.2
typescript 6.ts 99ms 1.3ms 36.5MB 90ms 0ms deno 1.30.0

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 2.v 507ms 3.1ms 11.0MB 497ms 0ms v/clang 0.3.2
v 2.v 510ms 3.1ms 10.7MB 493ms 3ms v/clang+gc 0.3.2
v 1.v 1164ms 113ms 41.1MB 1143ms 7ms v/clang+gc 0.3.2
v 1.v 1352ms 95ms 41.2MB 1330ms 7ms v/clang 0.3.2

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 2.v 116ms 0.4ms 4.0MB 107ms 0ms v/clang+gc 0.3.2
v 2.v 117ms 0.7ms 4.1MB 107ms 0ms v/clang 0.3.2
v 1.v 122ms 1.8ms 20.0MB 110ms 0ms v/clang+gc 0.3.2
v 1.v 129ms 2.2ms 20.8MB 113ms 0ms v/clang 0.3.2

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 3901ms 88ms 3.2MB 3873ms 10ms v/clang+gc 0.3.2
typescript 3.ts timeout 0.0ms 76.9MB 4987ms 23ms deno 1.30.0
v 1.v timeout 0.0ms 4.0MB 4980ms 7ms v/clang 0.3.2
v 2.v timeout 0.0ms 3.3MB 4983ms 7ms v/clang+gc 0.3.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
v 1.v 959ms 2.4ms 2.9MB 947ms 0ms v/clang+gc 0.3.2
v 1.v 1425ms 42ms 2.9MB 1410ms 0ms v/clang 0.3.2
typescript 3.ts 1553ms 23ms 57.3MB 1497ms 57ms deno 1.30.0
v 2.v 1737ms 35ms 2.7MB 1723ms 0ms v/clang+gc 0.3.2

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 7.ts 4858ms 5.1ms 39.4MB 4850ms 0ms deno 1.30.0
v 1.v timeout 0.0ms 3.0MB 4983ms 0ms v/clang 0.3.2
v 1.v timeout 0.0ms 3.1MB 4987ms 0ms v/clang+gc 0.3.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 7.ts 1242ms 1.2ms 38.2MB 1233ms 3ms deno 1.30.0
v 1.v 1551ms 0.4ms 2.8MB 1537ms 0ms v/clang 0.3.2
v 1.v 1556ms 5.3ms 2.8MB 1543ms 0ms v/clang+gc 0.3.2

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 7.ts 370ms 55ms 38.3MB 333ms 7ms deno 1.30.0
v 1.v 393ms 0.4ms 2.6MB 380ms 0ms v/clang+gc 0.3.2
v 1.v 400ms 9.6ms 2.5MB 380ms 0ms v/clang 0.3.2