ts-pattern
ts-pattern copied to clipboard
Compile-time performance optimization
Is your feature request related to a problem? Please describe. I've been enjoying this library a lot! However, after looking at the source, I'm a bit worried about the overall performance, since it looks much more expensive than usual conditional checks.
Describe the solution you'd like Introduce some kind of compilation step (Babel/SWC plugins? or even standalone) to optimize out the API calls.
Describe alternatives you've considered Not sure. Maybe waiting until JS engines natively support pattern matching and JIT for it? :P