Typescript VS Crystal 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
crystal 1.cr 1256ms 14ms 64.0MB 1233ms 7ms crystal 1.15.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 104ms 3.0ms 10.9MB 90ms 0ms crystal 1.15.1
typescript 1.ts 142ms 15ms 76.8MB 147ms 23ms deno 2.2.6

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 1216ms 13ms 19.6MB 1143ms 53ms crystal 1.15.1
typescript 1.ts 1219ms 15ms 121.0MB 1197ms 63ms deno 2.2.6

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 71ms 1.5ms 7.0MB 43ms 10ms crystal 1.15.1
typescript 1.ts 151ms 1.9ms 69.0MB 127ms 23ms deno 2.2.6

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 2.cr 557ms 5.8ms 3.4MB 460ms 77ms crystal 1.15.1
crystal 1.cr 698ms 1.4ms 14.4MB 580ms 107ms crystal 1.15.1
typescript 1.ts 2118ms 25ms 56.5MB 1987ms 137ms deno 2.2.6

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 2.cr 59ms 0.6ms 3.5MB 43ms 0ms crystal 1.15.1
crystal 1.cr 75ms 1.4ms 4.8MB 53ms 10ms crystal 1.15.1
typescript 1.ts 245ms 1.5ms 56.2MB 230ms 20ms deno 2.2.6

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 2.0ms 0.2ms 2.9MB 0ms 0ms crystal 1.15.1
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
crystal 1.cr 2484ms 156ms 256.0MB 320ms 500ms crystal 1.15.1

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
crystal 1.cr 1251ms 108ms 59.4MB 30ms 80ms crystal 1.15.1

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

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

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 0-unsafe.cr 37ms 0.6ms 2.9MB 30ms 0ms crystal 1.15.1
crystal 1.cr 66ms 1.0ms 2.9MB 60ms 0ms crystal 1.15.1
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

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 0-unsafe.cr 100ms 2.3ms 2.9MB 90ms 0ms crystal 1.15.1
crystal 1.cr 186ms 3.7ms 2.9MB 173ms 0ms crystal 1.15.1
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

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 0-unsafe.cr 18ms 0.8ms 2.9MB 10ms 0ms crystal 1.15.1
crystal 1.cr 32ms 1.0ms 2.9MB 20ms 0ms crystal 1.15.1
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

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
crystal 1.cr 847ms 17ms 64.0MB 823ms 10ms crystal 1.15.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 156ms 3.3ms 22.2MB 140ms 0ms crystal 1.15.1
typescript 1.ts 171ms 3.9ms 97.9MB 173ms 40ms deno 2.2.6

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 2.cr 343ms 2.0ms 3.1MB 333ms 0ms crystal 1.15.1
crystal 1.cr 345ms 1.8ms 3.1MB 337ms 0ms crystal 1.15.1
typescript 6.ts 468ms 6.1ms 56.1MB 453ms 10ms deno 2.2.6

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 38ms 1.2ms 3.1MB 30ms 0ms crystal 1.15.1
crystal 2.cr 39ms 0.8ms 3.1MB 30ms 0ms crystal 1.15.1
typescript 6.ts 81ms 1.2ms 54.5MB 70ms 10ms deno 2.2.6

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 1888ms 51ms 6.2MB 1860ms 13ms crystal 1.15.1
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
crystal 1.cr 458ms 11ms 4.9MB 447ms 0ms crystal 1.15.1
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

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

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 3796ms 8.8ms 4.4MB 3783ms 0ms crystal 1.15.1
typescript 7.ts 4123ms 70ms 56.5MB 4107ms 10ms deno 2.2.6

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 955ms 4.2ms 4.3MB 943ms 0ms crystal 1.15.1
typescript 7.ts 1039ms 3.5ms 56.1MB 1023ms 10ms deno 2.2.6

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 243ms 3.1ms 3.8MB 233ms 0ms crystal 1.15.1
typescript 7.ts 290ms 1.6ms 54.6MB 277ms 10ms deno 2.2.6