Javascript VS Go benchmarks

Current benchmark data was generated on Fri Aug 01 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
javascript 1-m.js 924ms 19ms 173.9MB 1400ms 193ms bun 1.2.19
javascript 1.js 1057ms 11ms 455.9MB 973ms 230ms node 24.4.1
go 1.go 1726ms 16ms 51.9MB 1707ms 10ms tinygo 0.38.0
go 1-m.go 2343ms 11ms 41.9MB 5213ms 33ms go 1.24.5

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 99ms 1.4ms 76.3MB 80ms 23ms bun 1.2.19
javascript 1.js 128ms 0.9ms 81.6MB 127ms 23ms node 24.4.1
go 1.go 152ms 0.5ms 5.0MB 140ms 0ms tinygo 0.38.0
go 1-m.go 207ms 1.7ms 8.3MB 367ms 7ms go 1.24.5

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 660ms 61ms 15.5MB 2573ms 0ms go 1.24.5
javascript 1.js 1682ms 32ms 189.9MB 1653ms 93ms node 24.4.1
javascript 1.js 2481ms 58ms 102.1MB 2540ms 57ms bun 1.2.19
go 1.go timeout 0.0ms 13.3MB 2440ms 17047ms tinygo 0.38.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-m.go 44ms 7.8ms 7.5MB 147ms 0ms go 1.24.5
javascript 1.js 157ms 2.7ms 75.6MB 147ms 23ms node 24.4.1
javascript 1.js 198ms 3.5ms 86.8MB 240ms 33ms bun 1.2.19
go 1-m.go 672ms 69ms 4.4MB 307ms 2230ms tinygo 0.38.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 118ms 0.3ms 10.5MB 110ms 0ms go 1.24.5
javascript 1.js 280ms 5.6ms 67.8MB 290ms 27ms node 24.4.1
javascript 1.js 519ms 4.8ms 74.4MB 497ms 17ms bun 1.2.19

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 33ms 0.4ms 8.2MB 23ms 0ms go 1.24.5
javascript 1.js 125ms 1.2ms 64.0MB 117ms 10ms node 24.4.1
javascript 1.js 508ms 2.5ms 63.9MB 487ms 17ms bun 1.2.19

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 0.8ms 0.1ms 0.3MB 0ms 0ms tinygo 0.38.0
go 1.go 1.5ms 0.1ms 3.4MB 0ms 0ms go 1.24.5
javascript 1.js 11ms 0.5ms 30.6MB 0ms 0ms bun 1.2.19
javascript 1.js 32ms 0.3ms 50.7MB 18ms 4ms node 24.4.1

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 119ms 2.9ms 56.1MB 333ms 80ms go 1.24.5
javascript 1-m.bun.js 261ms 2.3ms 73.4MB 127ms 327ms bun 1.2.19
go 1-m.go 378ms 12ms 172.9MB 707ms 580ms go 1.24.5
go 2-m.go 401ms 6.5ms 170.4MB 683ms 660ms go 1.24.5
javascript 1.js 2352ms 141ms 268.4MB 2327ms 1063ms node 24.4.1

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1-http2.go 22ms 13ms 23.8MB 65ms 20ms go 1.24.5
go 2-m.go 24ms 27ms 26.6MB 70ms 90ms go 1.24.5
go 1-m.go 70ms 2.8ms 36.9MB 90ms 100ms go 1.24.5
javascript 1.bun.js 95ms 13ms 53.6MB 33ms 80ms bun 1.2.19
javascript 1.js 344ms 5.6ms 85.4MB 330ms 123ms node 24.4.1

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 45ms 2.2ms 39.1MB 37ms 3ms go 1.24.5
javascript 1.js 66ms 1.5ms 61.6MB 40ms 17ms bun 1.2.19
javascript 1.js 104ms 1.5ms 75.6MB 93ms 13ms node 24.4.1
go 1.go 139ms 1.8ms 18.6MB 130ms 0ms go 1.24.5

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 2-ffi.go 259ms 16ms 149.3MB 240ms 60ms go 1.24.5
javascript 1.js 364ms 0.6ms 200.0MB 323ms 80ms bun 1.2.19
javascript 1.js 567ms 5.4ms 255.8MB 577ms 127ms node 24.4.1
go 1.go 751ms 4.5ms 103.6MB 737ms 20ms go 1.24.5

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 119ms 1.2ms 3.5MB 110ms 0ms go 1.24.5
go 3.go 134ms 2.9ms 0.4MB 127ms 0ms tinygo 0.38.0
javascript 2.js 305ms 1.5ms 65.3MB 297ms 10ms node 24.4.1
javascript 1.js 565ms 1.0ms 63.8MB 550ms 10ms node 24.4.1
javascript 2.js 688ms 2.6ms 121.7MB 750ms 53ms bun 1.2.19
javascript 1.js 855ms 21ms 104.9MB 920ms 103ms bun 1.2.19

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 385ms 3.2ms 0.4MB 373ms 0ms tinygo 0.38.0
go 3.go 387ms 4.2ms 3.5MB 380ms 0ms go 1.24.5
javascript 2.js 833ms 3.5ms 72.3MB 820ms 10ms node 24.4.1
javascript 1.js 1619ms 0.4ms 70.7MB 1597ms 13ms node 24.4.1
javascript 2.js 1924ms 12ms 121.8MB 2100ms 67ms bun 1.2.19
javascript 1.js 2374ms 12ms 104.9MB 2657ms 173ms bun 1.2.19

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 3.go 50ms 1.0ms 3.5MB 40ms 0ms go 1.24.5
go 3.go 65ms 2.2ms 0.3MB 60ms 0ms tinygo 0.38.0
javascript 2.js 164ms 1.1ms 59.4MB 153ms 10ms node 24.4.1
javascript 1.js 170ms 5.4ms 60.8MB 153ms 10ms node 24.4.1
javascript 1.js 318ms 2.6ms 129.6MB 357ms 77ms bun 1.2.19
javascript 2.js 374ms 2.9ms 124.3MB 403ms 53ms bun 1.2.19

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1-m.js 455ms 5.8ms 138.2MB 590ms 110ms bun 1.2.19
javascript 1.js 563ms 8.0ms 231.0MB 570ms 100ms node 24.4.1
go 1.go 1027ms 9.5ms 35.4MB 1010ms 0ms tinygo 0.38.0
go 2.go 1327ms 3.3ms 51.9MB 1307ms 10ms tinygo 0.38.0
go 1-m.go 1436ms 4.6ms 35.2MB 3040ms 37ms go 1.24.5
go 2-m.go 1649ms 17ms 40.9MB 3633ms 33ms go 1.24.5

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 112ms 1.9ms 82.8MB 100ms 33ms bun 1.2.19
javascript 1.js 157ms 4.3ms 100.8MB 150ms 37ms node 24.4.1
go 1.go 206ms 2.0ms 11.6MB 193ms 0ms tinygo 0.38.0
go 2.go 261ms 3.0ms 15.4MB 250ms 0ms tinygo 0.38.0
go 1-m.go 327ms 1.0ms 12.2MB 660ms 20ms go 1.24.5
go 2-m.go 368ms 1.6ms 14.0MB 770ms 27ms go 1.24.5

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 349ms 3.6ms 0.3MB 340ms 0ms tinygo 0.38.0
go 1.go 350ms 1.9ms 3.5MB 340ms 0ms go 1.24.5
javascript 6.js 460ms 3.5ms 59.2MB 447ms 10ms node 24.4.1
javascript 6.js 596ms 2.0ms 43.5MB 597ms 10ms bun 1.2.19

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 1.go 37ms 1.3ms 0.3MB 30ms 0ms tinygo 0.38.0
go 1.go 38ms 0.1ms 3.5MB 30ms 0ms go 1.24.5
javascript 6.js 79ms 0.9ms 43.5MB 80ms 3ms bun 1.2.19
javascript 6.js 79ms 2.5ms 58.8MB 67ms 7ms node 24.4.1

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 91ms 1.7ms 5.2MB 83ms 0ms go 1.24.5
javascript 1.js 2503ms 15ms 61.5MB 2507ms 13ms node 24.4.1
javascript 1.js 2801ms 4.4ms 82.0MB 2817ms 47ms bun 1.2.19

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 0-ffi.go 25ms 0.2ms 5.2MB 20ms 0ms go 1.24.5
javascript 1.js 674ms 2.9ms 59.6MB 680ms 10ms node 24.4.1
javascript 1.js 741ms 2.7ms 81.0MB 740ms 30ms bun 1.2.19

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 1120ms 3.1ms 10.7MB 1103ms 7ms go 1.24.5
javascript 3.js 4600ms 4.2ms 123.2MB 4550ms 50ms node 24.4.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 8.go 268ms 3.1ms 8.6MB 257ms 0ms go 1.24.5
javascript 3.js 1014ms 1.7ms 73.8MB 993ms 17ms node 24.4.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 1906ms 16ms 5.4MB 7413ms 3ms go 1.24.5
javascript 6-m.js 2185ms 26ms 119.6MB 8307ms 67ms node 24.4.1
go 1.go 3693ms 15ms 5.6MB 3690ms 0ms go 1.24.5
go 1.go timeout 0.0ms 0.5MB 4990ms 0ms tinygo 0.38.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 480ms 1.0ms 5.5MB 1843ms 0ms go 1.24.5
javascript 6-m.js 660ms 6.2ms 117.7MB 2340ms 50ms node 24.4.1
go 1.go 924ms 10ms 3.5MB 917ms 0ms go 1.24.5
go 1.go 1397ms 0.7ms 0.4MB 1390ms 0ms tinygo 0.38.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
go 4-m.go 125ms 1.2ms 5.6MB 457ms 0ms go 1.24.5
go 1.go 233ms 5.1ms 3.5MB 223ms 0ms go 1.24.5
javascript 6-m.js 273ms 4.5ms 114.4MB 847ms 47ms node 24.4.1
go 1.go 351ms 0.8ms 0.4MB 340ms 0ms tinygo 0.38.0