Cloudflare、VoidZero与Max Schwenk合作推出了tsrs,这是一个用Rust编写的TypeScript编译器移植版本1。该项目作为Oxc JavaScript编译器工具链的一部分进行孵化,旨在提升TypeScript的运行速度和内存效率1。
早期基准测试结果显示tsrs的性能优势明显——相比TypeScript 7.0,tsrs的编译速度快8倍,内存使用量则减少约70%1。这些性能改进已部分体现在TypeScript 7.1 beta版本上,该版本比7.0快2.5倍,部分优化源自tsrs向上游的贡献1。开发者选择Rust作为实现语言,是因为它能够编译为WebAssembly,相比Go的垃圾回收机制更具高效性1。
用户可以通过npm安装tsrs1。项目采用与Vinext类似的维护流程,每天检查上游变更,每晚重新生成兼容性矩阵1。在自适应配置模式下,tsrs虽然性能更快,但内存占用会相应增加1。
Cloudflare, VoidZero, and Max Schwenk have collaborated to introduce tsrs, a Rust-based port of the TypeScript compiler designed to significantly improve performance and memory efficiency.1 The project is being incubated as part of the Oxc JavaScript compiler toolchain.1
Early benchmarks demonstrate substantial improvements over the original implementation. Tsrs runs approximately 8 times faster than TypeScript 7.0 while reducing memory consumption by roughly 70 percent.1 The development has also influenced upstream TypeScript improvements, with TypeScript 7.1 beta showing 2.5 times faster performance than version 7.0, partly attributable to contributions derived from tsrs.1 The team selected Rust for its ability to compile to WebAssembly, offering greater efficiency compared to languages with garbage collection mechanisms like Go.1
The project is available for installation via npm with the command npm install tsrs.1 Tsrs employs a maintenance process similar to Vinext, checking for upstream changes daily and regenerating compatibility matrices each night.1 When running in adaptive configuration mode, tsrs achieves even faster performance, though this comes with increased memory usage.1
评论
还没有评论,欢迎留下第一条。