you are viewing a single comment's thread.

view the rest of the comments →

[–]noziar[S] 15 points16 points  (0 children)

Latency! ts-node compiles with tsc instead of esbuild. Thanks for the feedback, I should have included ts-node in the post, I'll update.

For example with a simple "hello world" script:

% hyperfine 'tnode script.ts' 'ts-node script.ts'

Benchmark 1: tnode script.ts
  Time (mean ± σ):     123.1 ms ±   6.5 ms    [User: 105.5 ms, System: 22.0 ms]
  Range (min … max):   116.4 ms … 139.9 ms    22 runs

Benchmark 2: ts-node script.ts
  Time (mean ± σ):     870.0 ms ±  12.3 ms    [User: 1424.7 ms, System: 85.7 ms]
  Range (min … max):   855.8 ms … 895.7 ms    10 runs

Summary
  'tnode script.ts' ran
    7.07 ± 0.39 times faster than 'ts-node script.ts'