https://github.com/multiprocessio/react-transformer-benchmarks
Benchmarking esbuild, swc, typescript, babel
https://github.com/multiprocessio/react-transformer-benchmarks
Last synced: 12 months ago
JSON representation
Benchmarking esbuild, swc, typescript, babel
- Host: GitHub
- URL: https://github.com/multiprocessio/react-transformer-benchmarks
- Owner: multiprocessio
- Created: 2021-11-12T17:17:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-13T22:41:04.000Z (over 4 years ago)
- Last Synced: 2025-01-23T01:13:04.483Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 29.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Transformer Benchmarks
This is a set of scripts that generates large fake React projects
using
[react-benchmark-generator](https://github.com/multiprocessio/react-benchmark-generator)
and runs transformers against these projects.
Read the full blog post [here](https://datastation.multiprocess.io/blog/2021-11-13-benchmarking-esbuild-swc-typescript-babel.html).
## Setup
Once you have this repo, run:
```bash
$ yarn
$ ./prepare.sh
```
prepare.sh will create 5 sample projects in a `tests` directory in 3
sizes: small, medium and large. They are basic projects that just
render JSX with builtin and custom components.
This script will take a while!
## Run
Once you have generated all tests you can run all benchmarks:
```bash
$ ./run.sh
```
This will dump a CSV to output.
## Analysis
If you redirect the run script output to a file you can easily analyze
it with SQLite.
```bash
$ ./run.sh | tee results.csv
$ sqlite3
sqlite> .mode csv
sqlite> .import results.csv results
sqlite> ^D
```
Then you can run queries:
```csv
$ sqlite3 bench.db 'SELECT name, size, AVG(time) FROM results GROUP BY name, size ORDER BY size DESC, AVG(time) ASC'
esbuild,small,0.33284
swc,small,0.38476
babel,small,1.44288
typescript,small,2.32456
esbuild,medium,0.80556
swc,medium,0.97588
typescript,medium,8.2286
babel,medium,12.8434
esbuild,large,3.06556
swc,large,3.8216
typescript,large,37.28584
babel,large,70.57572
```
## Debugging
Output for all runs is redirected to `./runlog` in the root of this
repo. You can `tail -f ./runlog` to follow all tests as they are run
and see error output if something fails.