ts-pattern icon indicating copy to clipboard operation
ts-pattern copied to clipboard

Compile-time performance optimization

Open XiNiHa opened this issue 3 years ago • 0 comments

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

XiNiHa avatar Aug 29 '22 22:08 XiNiHa