napi-rs Docs

swc

swc

npm Downloads GitHub stars

swc is a super-fast typescript / javascript compiler written in rust.

Performance

⚠️ Notes: transformSync API in esbuild has huge overhead. So swc is only faster than esbuild in transformSync API. In the transform API, esbuild is about 1 ~ 1.6x faster than swc.
transform RxJS AjaxObservable.ts to ES2015 & CommonJS JavaScript. Benchmark code: bench

Hardware info:

Model Name: MacBook Pro
Model Identifier: MacBookPro15,1
Processor Name: 6-Core Intel Core i7
Processor Speed: 2.6 GHz
Number of Processors: 1
Total Number of Cores: 6
L2 Cache (per Core): 256 KB
L3 Cache: 12 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB

transformSync

@swc/core x 368 ops/sec ±4.18% (84 runs sampled)
esbuild x 42.16 ops/sec ±1.76% (55 runs sampled)
typescript x 24.52 ops/sec ±14.38% (51 runs sampled)
babel x 22.08 ops/sec ±10.17% (44 runs sampled)
Transform rxjs/AjaxObservable.ts benchmark bench suite: Fastest is @swc/core

transform single thread

@swc/core x 291 ops/sec ±1.66% (78 runs sampled)
esbuild x 454 ops/sec ±3.66% (73 runs sampled)
Transform rxjs/AjaxObservable.ts async benchmark bench suite: Fastest is esbuild

transform parallel

@swc/core x 946 ops/sec ±2.36% (74 runs sampled)
esbuild x 931 ops/sec ±3.56% (65 runs sampled)
Transform rxjs/AjaxObservable.ts parallel benchmark bench suite: Fastest is @swc-node/core,esbuild
Edit this page on GitHub