# swc-project/swc-next · xMas Performance Challenge by CodSpeed

> A fast JavaScript and TypeScript compiler in Rust, and the next major version of SWC.

SWC parses, transforms and minifies the JavaScript and TypeScript of Next.js, Deno, Rspack and Parcel projects. swc-next is its next major version: the same toolchain in Rust, built around a flat, ESTree-based AST.

SWC compiles the JavaScript and TypeScript of Next.js, Deno, Rspack and Parcel projects, on every save and every build. swc-next is set to become SWC's next major version, so the speedups made here reach those dev servers and builds.

## Facts

- Repository: https://github.com/swc-project/swc-next
- Language: Rust, with a JavaScript API (@swc-next/core)
- License: Apache-2.0
- Open: Tue Dec 1 to Dec 31, 23:59 UTC
- Measured: Walltime, on [CodSpeed Macro Runners Gen 2](https://codspeed.io/docs/features/macro-runners#amd-ryzen-9950x-x86_64)
- Frozen at upstream commit 932da79

## Start

```sh
curl -fsSL https://xmas.codspeed.io/install.sh | sh
codspeed-xmas init swc-project/swc-next
```

Windows: `powershell -ExecutionPolicy Bypass -c "irm https://xmas.codspeed.io/install.ps1 | iex"`. More in the [CLI README](https://github.com/CodSpeedHQ/codspeed/blob/main/crates/codspeed-xmas/README.md).

## What to make faster

- `tasks/benchmark/benches/parser.rs` (parser): Parsing speed: turns 11 real-world sources into an AST, from jQuery and Angular to TypeScript's own compiler, a TSX app and heavy type definitions.
- `tasks/benchmark/benches/visit.rs` (visit): AST traversal speed: walks the parsed TypeScript compiler and a TSX file with the read-only visitor, the mutable visitor and the traverser.
- `tasks/benchmark/benches/semantic.rs` (semantic): Semantic analysis speed: scopes, bindings and references over an already parsed AST. Parsing is not timed.
- `tasks/benchmark/benches/type_strip.rs` (type_strip): TypeScript type stripping speed, source text in, JavaScript out, on three type-heavy files (Astro config, Effect Schema, Hono types).
- `tasks/benchmark/benches/minifier.rs` (minifier): Minification speed on Underscore, Angular and the TypeScript compiler. Parsing is not timed.

## Rules

- Submit only with the CodSpeed CLI. Don't open issues or pull requests on swc-project/swc-next.
- AI tools are allowed and encouraged.
- swc-next's own tests have to pass. CodSpeed runs the frozen benchmarks on every submission; your speedup sets your rank.
- When submissions close, entries that break tests, only game a benchmark or aren't of mergeable quality are set aside. In early January the swc-next maintainers choose what they want merged upstream.
- By submitting, you license your changes under swc-next's own license (Apache-2.0).
- Full rules: [official rules (PDF)](https://xmas.codspeed.io/official-rules.pdf)

## Prizes

- The top 3 entries the swc-next maintainers choose split swc-next's share of the $15,000 project pool (50% / 30% / 20%), paid in cash.
- $20,000 in total prizes across the challenge: https://xmas.codspeed.io/#prizes

## Maintainers

- DongYun Kang (Donny) ([@kdy1](https://github.com/kdy1))

## Links

- Page: https://xmas.codspeed.io/projects/swc-next
- Discord: https://discord.gg/5kU3aV2sRN
- All projects: https://xmas.codspeed.io/llms.txt
