GithubHelp home page GithubHelp logo

nathanforce / swc-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swc-project/swc-node

0.0 1.0 0.0 2.59 MB

Faster ts-node without typecheck

License: MIT License

JavaScript 0.66% TypeScript 99.04% Shell 0.29%

swc-node's Introduction

swc-node

Fast TypeScript/JavaScript transformer without node-gyp and postinstall script.

Build Status Downloads License

Support matrix

node 10 node12 node14
Windows x64
macOS
Linux x64

@swc-node/core

Fastest TypeScript transformer.

Detail: @swc-node/core

Benchmark

⚠️ 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-node/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-node/core

transform single thread

@swc-node/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-node/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

@swc-node/jest

Fastest jest TypeScript transformer.

Detail: @swc-node/jest

Performance glance

Testing in pure TypeScript project, compile target is ES2018. Running with npx jest --no-cache, ts-jest was configured with isolatedModules: true

ts-jest

Test Suites: 49 passed, 49 total
Tests:       254 passed, 254 total
Snapshots:   53 passed, 53 total
Time:        54.631 s
Ran all test suites.
✨  Done in 62.71s.

@swc-node/jest

Test Suites: 49 passed, 49 total
Tests:       254 passed, 254 total
Snapshots:   53 passed, 53 total
Time:        10.511 s
Ran all test suites.
✨  Done in 14.34s.

@swc-node/register

Faster ts-node/register/transpile-only alternative.

Detail: @swc-node/register

Development

Install dependencies

Build and test

  • yarn
  • cargo build --release && yarn build
  • yarn test

swc-node's People

Contributors

brooooooklyn avatar dependabot[bot] avatar herringtondarkholme avatar itsoli avatar kdy1 avatar moltar avatar natemoo-re avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.