The Computer Language
24.11 Benchmarks Game

Python 3 versus Node.js fastest performance

How the programs are written matters! 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 seconds, less gz source code.

fannkuch-redux
source secs mem gz cpu secs
Node.js #5 11.05 101,616 1320 43.85
Node.js #8 58.06 51,484 452 58.05
Python 3 #6 1,033.31 19,312 391 1,033.27
Python 3 #4 302.37 19,312 960 1,196.45
Python 3 #8 2,259.59 19,312 414 2,259.50
n-body
source secs mem gz cpu secs
Node.js #6 8.55 54,100 1274 8.56
Node.js #8 9.58 53,716 1173 9.59
Python 3 355.06 19,312 1201 355.05
Python 3 #2 374.16 19,312 1247 374.14
Python 3 #8 518.11 19,312 1172 518.09
spectral-norm
source secs mem gz cpu secs
Node.js #7 5.36 53,724 420 5.37
Node.js 5.37 54,808 326 5.39
Node.js #6 1.56 107,280 1002 5.99
Node.js #8 6.49 54,632 355 6.50
Python 3 #6 347.53 19,316 334 347.52
Python 3 #4 90.52 19,308 415 359.95
Python 3 #8 379.97 19,440 334 379.96
Python 3 #7 97.11 19,316 425 380.79
mandelbrot
source secs mem gz cpu secs
Node.js #3 4.00 135,476 1128 15.83
Node.js #2 29.36 61,144 422 29.39
Node.js 70.55 55,900 380 70.64
Node.js #8 72.49 56,116 412 72.52
Python 3 #7 172.20 19,312 698 687.68
Python 3 #3 861.76 19,312 319 861.73
Python 3 #2 235.71 95,164 790 926.30
Python 3 #5 257.00 19,312 463 1,026.96
Python 3 #8 1,528.00 19,364 379 1,527.73
fasta
source secs mem gz cpu secs
* Node.js #5 2.52 112,392 2050 7.08
Node.js 38.40 58,880 815 38.77
Python 3 #2 39.00 19,312 1126 39.00
Python 3 #3 39.12 19,312 1007 39.12
Python 3 #5 27.86 827,284 1951 53.94
Python 3 57.21 19,312 823 57.20
Python 3 #8 259.98 19,312 730 259.80
Node.js #8 531.27 62,400 723 531.53
k-nucleotide
source secs mem gz cpu secs
Node.js #3 16.48 436,784 1817 44.54
Node.js #2 38.24 486,844 941 112.58
Node.js 39.98 356,716 1011 117.63
Python 3 #3 50.15 262,368 1970 185.77
Python 3 #4 79.01 506,112 663 236.67
Python 3 238.45 499,072 499 237.78
Python 3 #8 238.78 623,448 525 237.93
Python 3 #9 68.33 379,392 614 238.74
Node.js #8   Bad Output  
reverse-complement
source secs mem gz cpu secs
Python 3 #3 4.86 507,712 803 4.86
Python 3 #5 4.09 1,500,716 960 7.41
Python 3 #2 10.08 1,788,136 440 10.08
Python 3 10.29 1,986,440 484 10.29
Python 3 #6 7.38 2,484,372 821 10.89
Python 3 #4 13.41 4,002,688 343 13.41
* Node.js #2 15.44 731,804 1228 16.09
* Node.js #7   Bad Output  
binary-trees
source secs mem gz cpu secs
Node.js #7 16.02 1,070,260 458 28.26
Node.js #6 8.60 1,250,816 752 30.68
Node.js #8 19.86 1,334,104 521 32.74
Node.js 8.92 1,405,276 717 33.60
Python 3 #2 100.90 271,872 344 100.89
Python 3 #4 33.61 276,992 481 121.96
Python 3 #5 35.49 274,816 669 126.17
Python 3 36.12 276,992 597 127.68
Python 3 #3 52.28 671,872 1247 149.07
Python 3 #8 558.92 798,336 535 558.85
pidigits
source secs mem gz cpu secs
Node.js #4 1.11 59,620 487 1.14
* Python 3 #3 1.26 19,312 573 1.26
Python 3 #4 4.54 19,312 348 4.54
Node.js #2 12.16 87,228 405 12.19
Node.js #3 12.25 87,708 431 12.28
Python 3 #5   Failed  
regex-redux
source secs mem gz cpu secs
* Python 3 #2 1.35 168,236 1411 2.64
Node.js #3 4.27 796,080 675 5.30
Node.js #4 5.41 978,952 471 5.56
Python 3 8.91 432,220 515 16.44
Python 3

Python 3.13.0

Node.js

v23.0.0