Crystal VS Typescript benchmarks

Current benchmark data was generated on Mon Mar 31 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 1084ms 17ms 459.7MB 1020ms 223ms deno 2.2.6
crystal 1.cr 1256ms 12ms 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 1.3ms 10.9MB 90ms 0ms crystal 1.15.1
typescript 1.ts 130ms 2.0ms 77.5MB 130ms 27ms deno 2.2.6

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 1183ms 19ms 121.1MB 1180ms 53ms deno 2.2.6
crystal 1.cr 1316ms 23ms 19.6MB 1243ms 57ms crystal 1.15.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 72ms 2.7ms 7.0MB 50ms 10ms crystal 1.15.1
typescript 1.ts 147ms 1.1ms 70.8MB 127ms 20ms deno 2.2.6

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 60ms 2.0ms 6.4MB 50ms 0ms crystal 1.15.1

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 23ms 1.0ms 5.1MB 10ms 0ms crystal 1.15.1

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 2498ms 12ms 2.8MB 2487ms 0ms crystal 1.15.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 206ms 0.7ms 2.9MB 200ms 0ms crystal 1.15.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 2.cr 554ms 2.5ms 3.4MB 460ms 80ms crystal 1.15.1
crystal 1.cr 695ms 3.3ms 14.4MB 573ms 110ms crystal 1.15.1
typescript 1.ts 2073ms 8.5ms 56.1MB 1933ms 150ms 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.8ms 3.5MB 40ms 7ms crystal 1.15.1
crystal 1.cr 74ms 0.8ms 4.8MB 53ms 10ms crystal 1.15.1
typescript 1.ts 242ms 1.2ms 57.5MB 223ms 23ms deno 2.2.6

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 1.9ms 0.1ms 2.9MB 0ms 0ms crystal 1.15.1
typescript 1.ts 27ms 0.4ms 44.2MB 10ms 8ms deno 2.2.6

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 2-m.ts 645ms 6.3ms 232.7MB 607ms 413ms deno 2.2.6
typescript 1-m.ts 659ms 14ms 234.8MB 607ms 437ms deno 2.2.6
typescript 1-http2.ts 812ms 7.3ms 241.8MB 740ms 430ms deno 2.2.6
typescript 2-tls.ts 1461ms 69ms 256.8MB 1293ms 543ms deno 2.2.6
crystal 1.cr 1964ms 262ms 272.8MB 323ms 513ms crystal 1.15.1

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 2.ts 164ms 3.7ms 89.9MB 123ms 93ms deno 2.2.6
typescript 1.ts 168ms 4.3ms 91.3MB 120ms 100ms deno 2.2.6
typescript 1-http2.ts 209ms 1.1ms 92.9MB 160ms 93ms deno 2.2.6
typescript 2-tls.ts 340ms 4.3ms 98.5MB 267ms 123ms deno 2.2.6
crystal 1.cr 1255ms 106ms 59.1MB 33ms 80ms crystal 1.15.1

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 0-unsafe.cr 36ms 0.5ms 2.9MB 30ms 0ms crystal 1.15.1
crystal 1.cr 65ms 1.2ms 2.9MB 57ms 0ms crystal 1.15.1
typescript 2.ts 274ms 1.3ms 61.1MB 267ms 10ms deno 2.2.6
typescript 1.ts 584ms 12ms 59.9MB 567ms 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 102ms 0.4ms 2.9MB 90ms 0ms crystal 1.15.1
crystal 1.cr 184ms 1.1ms 2.9MB 170ms 0ms crystal 1.15.1
typescript 2.ts 739ms 3.9ms 68.6MB 723ms 20ms deno 2.2.6
typescript 1.ts 1675ms 4.5ms 66.6MB 1650ms 20ms 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.7ms 3.0MB 10ms 0ms crystal 1.15.1
crystal 1.cr 31ms 1.7ms 2.9MB 20ms 0ms crystal 1.15.1
typescript 2.ts 140ms 1.3ms 58.8MB 130ms 10ms deno 2.2.6
typescript 1.ts 171ms 2.9ms 57.2MB 157ms 10ms deno 2.2.6

mandelbrot

Input: 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 313ms 1.6ms 9.2MB 300ms 0ms crystal 1.15.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 18ms 0.3ms 6.1MB 10ms 0ms crystal 1.15.1

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 1.ts 568ms 5.3ms 226.2MB 573ms 110ms deno 2.2.6
crystal 1.cr 824ms 8.5ms 64.0MB 800ms 10ms crystal 1.15.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 146ms 2.3ms 22.1MB 130ms 0ms crystal 1.15.1
typescript 1.ts 157ms 1.4ms 98.1MB 157ms 40ms deno 2.2.6

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 344ms 1.7ms 3.1MB 333ms 0ms crystal 1.15.1
crystal 2.cr 345ms 2.2ms 3.1MB 337ms 0ms crystal 1.15.1
typescript 6.ts 465ms 4.3ms 54.3MB 453ms 10ms deno 2.2.6

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 2.cr 38ms 0.8ms 3.1MB 30ms 0ms crystal 1.15.1
crystal 1.cr 39ms 1.3ms 3.1MB 30ms 0ms crystal 1.15.1
typescript 6.ts 78ms 1.6ms 56.2MB 63ms 10ms deno 2.2.6

nsieve

Input: 12

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 2.cr 298ms 0.7ms 8.1MB 290ms 0ms crystal 1.15.1
crystal 1.cr 416ms 4.8ms 42.3MB 403ms 0ms crystal 1.15.1

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 2.cr 77ms 1.4ms 4.4MB 70ms 0ms crystal 1.15.1
crystal 1.cr 89ms 2.5ms 13.0MB 80ms 0ms crystal 1.15.1

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 1937ms 28ms 6.1MB 1903ms 17ms crystal 1.15.1
typescript 3.ts timeout 0.0ms 130.4MB 4970ms 57ms deno 2.2.6

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 461ms 9.8ms 5.0MB 447ms 0ms crystal 1.15.1
typescript 3.ts 1253ms 12ms 77.9MB 1200ms 73ms 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 3779ms 15ms 4.4MB 3773ms 0ms crystal 1.15.1
typescript 7.ts 4035ms 5.6ms 54.7MB 4020ms 7ms deno 2.2.6

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 952ms 5.3ms 4.3MB 943ms 0ms crystal 1.15.1
typescript 7.ts 1036ms 1.0ms 56.0MB 1023ms 7ms deno 2.2.6

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
crystal 1.cr 246ms 0.8ms 3.8MB 237ms 0ms crystal 1.15.1
typescript 7.ts 286ms 1.5ms 54.5MB 270ms 7ms deno 2.2.6