Skip to content

bdbaraban/ts-pattern-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

npm install
npm run test

Results

Running "ts-pattern-benchmark" suite...
Progress: 100%

  .exhaustive():
    1 440 678 ops/s, ±0.77%       | 99.86% slower

  .otherwise():
    1 482 380 ops/s, ±0.67%       | 99.86% slower

  .run():
    1 313 796 ops/s, ±0.22%       | slowest, 99.87% slower

  if/else:
    1 039 743 389 ops/s, ±0.14%   | fastest

  switch:
    1 033 490 278 ops/s, ±0.40%   | 0.6% slower

  ternary:
    1 021 137 268 ops/s, ±0.42%   | 1.79% slower

Finished 6 cases!
  Fastest: if/else
  Slowest: .run()

ts-pattern-benchmark

About

Benchmarking ts-pattern against built-in conditionals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published