Typescript VS Python benchmarks

Current benchmark data was generated on Sat Mar 29 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
typescript 1.ts 1119ms 12ms 476.2MB 1043ms 237ms deno 2.2.6
python 1.py 1186ms 0.8ms 96.2MB 1120ms 50ms pypy 3.10.16
python 1.py timeout 0.0ms 40.8MB 4970ms 17ms cpython 3.13.2
python 1.py timeout 0.0ms 40.6MB 4760ms 220ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 98ms 2.9ms 68.8MB 70ms 13ms pypy 3.10.16
typescript 1.ts 142ms 15ms 76.8MB 147ms 23ms deno 2.2.6
python 1.py 484ms 4.4ms 11.9MB 460ms 10ms pyston 3.8.12
python 1.py 745ms 25ms 12.6MB 737ms 0ms cpython 3.13.2

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 1218ms 8.4ms 107.6MB 1167ms 40ms pypy 3.10.16
typescript 1.ts 1219ms 15ms 121.0MB 1197ms 63ms deno 2.2.6
python 1.py 2748ms 76ms 25.1MB 2727ms 7ms cpython 3.13.2
python 1.py timeout 0.0ms 17.3MB 4980ms 10ms pyston 3.8.12

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 151ms 1.9ms 69.0MB 127ms 23ms deno 2.2.6
python 1.py 222ms 2.1ms 86.9MB 187ms 17ms pypy 3.10.16
python 1.py 239ms 4.5ms 20.4MB 223ms 3ms cpython 3.13.2
python 1.py 657ms 9.5ms 16.8MB 640ms 7ms pyston 3.8.12

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 1871ms 16ms 88.8MB 1820ms 37ms pypy 3.10.16
typescript 1.ts 2118ms 25ms 56.5MB 1987ms 137ms deno 2.2.6
python 5-m.py 2286ms 25ms 65.4MB 3523ms 857ms pypy 3.10.16
python 5-m.py 2628ms 276ms 12.5MB 3513ms 1170ms pyston 3.8.12
python 1.py 3017ms 11ms 8.1MB 3000ms 0ms pyston 3.8.12
python 5-m.py 3415ms 25ms 13.6MB 4547ms 940ms cpython 3.13.2
python 1.py 4761ms 15ms 8.8MB 4747ms 0ms cpython 3.13.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 245ms 1.5ms 56.2MB 230ms 20ms deno 2.2.6
python 1.py 253ms 1.6ms 63.4MB 220ms 20ms pypy 3.10.16
python 1.py 314ms 5.5ms 8.1MB 303ms 0ms pyston 3.8.12
python 5-m.py 336ms 9.5ms 12.5MB 440ms 160ms pyston 3.8.12
python 5-m.py 404ms 2.2ms 13.5MB 487ms 137ms cpython 3.13.2
python 5-m.py 447ms 0.8ms 65.4MB 747ms 307ms pypy 3.10.16
python 1.py 490ms 12ms 8.8MB 477ms 0ms cpython 3.13.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 1.py 11ms 0.6ms 7.6MB 0ms 0ms pyston 3.8.12
python 1.py 14ms 1.2ms 8.6MB 10ms 0ms cpython 3.13.2
python 1.py 29ms 0.5ms 51.6MB 8ms 10ms pypy 3.10.16
typescript 1.ts 29ms 0.6ms 44.6MB 10ms 6ms deno 2.2.6

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1-m.ts 749ms 22ms 238.5MB 700ms 457ms deno 2.2.6
typescript 2.ts 808ms 28ms 234.0MB 733ms 467ms deno 2.2.6
typescript 1-http2.ts 867ms 21ms 242.9MB 807ms 440ms deno 2.2.6
typescript 2-tls.ts 1536ms 8.6ms 258.7MB 1370ms 567ms deno 2.2.6
python 1.py 2324ms 184ms 26.6MB 1127ms 1567ms pyston 3.8.12
python 1.py 2773ms 352ms 27.4MB 1603ms 1647ms cpython 3.13.2
python 1.py 4799ms 63ms 105.0MB 2877ms 1247ms pypy 3.10.16

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 183ms 5.6ms 91.3MB 133ms 100ms deno 2.2.6
typescript 2.ts 185ms 5.7ms 90.2MB 133ms 107ms deno 2.2.6
typescript 1-http2.ts 242ms 20ms 90.3MB 173ms 107ms deno 2.2.6
typescript 2-tls.ts 378ms 16ms 95.3MB 300ms 130ms deno 2.2.6
python 1.py 1102ms 29ms 21.4MB 230ms 297ms pyston 3.8.12
python 1.py 1123ms 32ms 22.8MB 323ms 273ms cpython 3.13.2
python 1.py 1786ms 128ms 85.1MB 727ms 237ms pypy 3.10.16

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 171ms 5.3ms 91.7MB 170ms 33ms deno 2.2.6
python 1.py 206ms 5.8ms 38.2MB 173ms 20ms pyston 3.8.12
python 1.py 223ms 2.0ms 38.6MB 197ms 13ms cpython 3.13.2
python 1.py 299ms 2.4ms 89.5MB 267ms 20ms pypy 3.10.16

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 1215ms 5.5ms 416.9MB 1340ms 150ms deno 2.2.6
python 1.py 1848ms 16ms 220.5MB 1673ms 163ms pyston 3.8.12
python 1.py 1936ms 8.2ms 221.4MB 1830ms 90ms cpython 3.13.2
python 1.py 1937ms 15ms 222.2MB 1857ms 67ms pypy 3.10.16

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 146ms 1.8ms 58.3MB 120ms 10ms pypy 3.10.16
python 1.py 181ms 2.9ms 59.3MB 153ms 13ms pypy 3.10.16
typescript 2.ts 288ms 1.6ms 63.8MB 273ms 20ms deno 2.2.6
typescript 1.ts 591ms 5.4ms 61.5MB 570ms 13ms deno 2.2.6
python 1.py 726ms 9.4ms 8.9MB 713ms 0ms pyston 3.8.12
python 2.py 831ms 7.8ms 8.5MB 817ms 0ms pyston 3.8.12
python 1.py 1180ms 49ms 9.3MB 1170ms 0ms cpython 3.13.2
python 2.py 1336ms 19ms 9.0MB 1323ms 0ms cpython 3.13.2

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 342ms 5.4ms 59.2MB 313ms 10ms pypy 3.10.16
python 1.py 379ms 2.8ms 60.3MB 350ms 13ms pypy 3.10.16
typescript 2.ts 774ms 11ms 71.1MB 763ms 20ms deno 2.2.6
typescript 1.ts 1669ms 5.0ms 66.9MB 1647ms 23ms deno 2.2.6
python 1.py 2144ms 4.0ms 8.9MB 2130ms 0ms pyston 3.8.12
python 2.py 2479ms 16ms 8.5MB 2463ms 0ms pyston 3.8.12
python 1.py 3519ms 155ms 9.3MB 3507ms 0ms cpython 3.13.2
python 2.py 3929ms 97ms 9.0MB 3917ms 0ms cpython 3.13.2

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 2.py 105ms 2.1ms 58.1MB 83ms 10ms pypy 3.10.16
python 1.py 122ms 3.8ms 58.7MB 97ms 10ms pypy 3.10.16
typescript 2.ts 147ms 3.0ms 58.2MB 133ms 10ms deno 2.2.6
typescript 1.ts 177ms 1.2ms 59.0MB 157ms 20ms deno 2.2.6
python 1.py 348ms 2.4ms 8.5MB 337ms 0ms pyston 3.8.12
python 2.py 387ms 3.3ms 8.1MB 373ms 0ms pyston 3.8.12
python 1.py 551ms 21ms 9.0MB 540ms 0ms cpython 3.13.2
python 2.py 640ms 9.1ms 8.8MB 627ms 0ms cpython 3.13.2

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 633ms 5.8ms 226.3MB 657ms 107ms deno 2.2.6
python 1.py 2248ms 18ms 202.7MB 2120ms 107ms pypy 3.10.16
python 1.py timeout 0.0ms 93.9MB 4960ms 27ms cpython 3.13.2
python 1.py timeout 0.0ms 130.4MB 4937ms 43ms pyston 3.8.12

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 171ms 3.9ms 97.9MB 173ms 40ms deno 2.2.6
python 1.py 386ms 6.0ms 105.2MB 323ms 47ms pypy 3.10.16
python 1.py 3142ms 32ms 37.1MB 3113ms 13ms cpython 3.13.2
python 1.py timeout 0.0ms 48.8MB 4970ms 20ms pyston 3.8.12

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 6.ts 468ms 6.1ms 56.1MB 453ms 10ms deno 2.2.6
python 2.py 1361ms 7.5ms 57.9MB 1337ms 10ms pypy 3.10.16
python 1.py 2657ms 16ms 57.2MB 2630ms 7ms pypy 3.10.16
python 1.py timeout 0.0ms 8.6MB 4990ms 0ms cpython 3.13.2
python 2.py timeout 0.0ms 8.8MB 4987ms 0ms cpython 3.13.2
python 1.py timeout 0.0ms 8.3MB 4990ms 0ms pyston 3.8.12
python 2.py timeout 0.0ms 8.1MB 4987ms 0ms pyston 3.8.12

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 6.ts 81ms 1.2ms 54.5MB 70ms 10ms deno 2.2.6
python 2.py 180ms 2.3ms 57.9MB 157ms 10ms pypy 3.10.16
python 1.py 303ms 3.6ms 57.1MB 277ms 10ms pypy 3.10.16
python 1.py 945ms 42ms 8.3MB 930ms 0ms pyston 3.8.12
python 2.py 1310ms 7.2ms 8.3MB 1297ms 0ms pyston 3.8.12
python 1.py 3278ms 579ms 8.6MB 3270ms 0ms cpython 3.13.2
python 2.py 3298ms 42ms 8.8MB 3287ms 0ms cpython 3.13.2

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 4.py 1916ms 3.0ms 8.9MB 1873ms 30ms pyston 3.8.12
python 4.py 1946ms 3.1ms 9.3MB 1893ms 37ms cpython 3.13.2
python 4.py 2189ms 9.6ms 89.4MB 2150ms 27ms pypy 3.10.16
typescript 3.ts timeout 0.0ms 130.4MB 4970ms 60ms deno 2.2.6

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
python 4.py 452ms 3.0ms 8.6MB 440ms 0ms pyston 3.8.12
python 4.py 465ms 2.7ms 9.1MB 453ms 0ms cpython 3.13.2
python 4.py 559ms 4.1ms 83.9MB 520ms 23ms pypy 3.10.16
typescript 3.ts 1271ms 8.5ms 77.7MB 1220ms 77ms deno 2.2.6

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 1939ms 11ms 59.6MB 1937ms 13ms deno 2.2.6
python 1.py 3200ms 57ms 8.3MB 3193ms 0ms pyston 3.8.12
python 1.py 3539ms 28ms 74.3MB 3503ms 27ms pypy 3.10.16
python 1.py 3863ms 72ms 8.6MB 3847ms 0ms cpython 3.13.2

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 529ms 2.5ms 55.9MB 533ms 10ms deno 2.2.6
python 1.py 808ms 5.8ms 8.3MB 797ms 0ms pyston 3.8.12
python 1.py 990ms 9.8ms 8.6MB 980ms 0ms cpython 3.13.2
python 1.py 1000ms 9.6ms 67.3MB 973ms 17ms pypy 3.10.16

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 7.ts 4123ms 70ms 56.5MB 4107ms 10ms deno 2.2.6
python 8.py timeout 0.0ms 14.6MB 37ms 7ms cpython 3.13.2
python 8.py timeout 0.0ms 95.4MB 797ms 97ms pypy 3.10.16
python 8.py timeout 0.0ms 14.2MB 33ms 10ms pyston 3.8.12

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 7.ts 1039ms 3.5ms 56.1MB 1023ms 10ms deno 2.2.6
python 8.py timeout 0.0ms 14.5MB 53ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 96.1MB 1303ms 183ms pypy 3.10.16
python 8.py timeout 0.0ms 13.5MB 60ms 20ms pyston 3.8.12

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 7.ts 290ms 1.6ms 54.6MB 277ms 10ms deno 2.2.6
python 8-m.py 1980ms 4.3ms 93.0MB 6417ms 260ms pypy 3.10.16
python 8.py timeout 0.0ms 14.0MB 97ms 13ms cpython 3.13.2
python 8.py timeout 0.0ms 13.2MB 143ms 40ms pyston 3.8.12