The Computer Language
22.05 Benchmarks Game

Fastest cpu secs Python 3 versus Node js

Always look at the source code.

If the fastest programs are hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more cpu seconds, less gz source code.

fannkuch-redux
source mem gz cpu
Node js #5 85,336 1313 44.58
Python 3 #6 7,432 385 1,279.15
Python 3 #4 45,420 950 1,336.72
n-body
source mem gz cpu
Node js #6 41,056 1268 8.43
Python 3 7,756 1196 575.02
Python 3 #2 8,244 1242 592.71
spectral-norm
source mem gz cpu
Node js #7 41,524 414 5.38
Node js 41,668 319 5.45
Node js #6 90,932 999 6.20
Python 3 #6 9,332 328 436.79
Python 3 #8 48,336 407 472.82
Python 3 #7 48,400 417 494.32
mandelbrot
source mem gz cpu
Node js #3 118,180 1122 16.00
Node js #2 48,484 416 28.21
Node js 43,580 373 65.26
Python 3 #7 46,192 688 706.10
Python 3 #5   Failed  
Python 3 #2   Timed Out  
pidigits
source mem gz cpu
Python 3 #3 11,968 567 1.13
Node js #4 45,096 481 1.14
Python 3 #4 8,668 342 4.06
Node js #2 72,556 397 13.11
Node js #3 72,536 424 13.22
Python 3 #2   Bad Output  
regex-redux
source mem gz cpu
Python 3 #2 111,680 1403 2.66
Node js #3 1,045,556 668 5.97
Node js #4 985,940 463 6.24
Python 3 458,264 512 17.86
fasta
source mem gz cpu
Node js #5 101,844 2047 6.38
Node js 50,304 809 37.60
Python 3 #2 8,184 1121 60.26
Python 3 #3 8,112 1003 60.50
Python 3 8,040 817 70.54
Python 3 #5 837,684 1947 71.74
k-nucleotide
source mem gz cpu
Node js #3 419,748 1812 43.70
Node js #2 72,156 935 112.88
Node js 621,752 1008 115.69
Python 3 #3 252,668 1967 172.53
Python 3 351,092 607 240.16
Python 3 #8 473,988 655 242.16
reverse-complement
source mem gz cpu
Node js #7 1,556,168 1480 4.97
Python 3 #2 1,786,488 434 9.38
Python 3 1,979,276 479 9.63
Python 3 #6 1,005,184 814 10.64
Python 3 #4 4,001,684 335 12.31
Node js #2 727,572 1221 16.87
binary-trees
source mem gz cpu
Node js #6 1,322,340 744 27.83
Node js 1,173,028 711 36.72
Node js #7 1,107,220 451 40.72
Python 3 #2 270,872 338 148.09
Python 3 #5 273,284 660 172.44
Python 3 #4 456,220 472 176.37
Python 3 282,996 589 178.66
Python 3 #3 669,832 1238 230.73
Python 3

Python 3.10.4

Node js

v18.1.0