Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmdartus/prettier-benchmark
Performance benchmark for Prettier CLI
https://github.com/pmdartus/prettier-benchmark
Last synced: 8 days ago
JSON representation
Performance benchmark for Prettier CLI
- Host: GitHub
- URL: https://github.com/pmdartus/prettier-benchmark
- Owner: pmdartus
- Created: 2023-11-22T06:17:51.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-11-25T08:45:18.000Z (12 months ago)
- Last Synced: 2024-10-18T19:01:12.991Z (28 days ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prettier performance benchmark
Checkout and build locally different versions of Prettier, and compare the performance of multiple CLI version against large JavaScript / TypeScript repositories. The performance comparison is done using [hyperfine](https://github.com/sharkdp/hyperfine).
## Scripts
### `scripts/setup-prettier.sh`
**Description:** Install and build a specific version of prettier.
**Usage:** `./scripts/setup-prettier.sh `
**Arguments:**
- `directory`: The prettier installation directory.
- `github-reference`: The github shorthand reference of a prettier repository.**Example:**
```sh
$ ./scripts/setup-prettier.sh baseline "prettier/prettier#main"
```### `scripts/benchmark.js`
**Description:** Run Prettier CLI performance benchmark
**Usage:** `./scripts/benchmark.js [options] [name]`
**Arguments:**
- `name`: The name of the benchmark to run. If omitted, the CLI runs all the benchmarks.**Options:**
- `--baseline `: The baseline Prettier CLI filename. (required)
- `--target `: The target Prettier CLI filename.
- `--runs `: Number of iteration to perform for each command. (default: `10`)
- `--warmup `: Number of iteration used to warmup the command. (default: `1`)
- `--export-json `: Export benchmark results as JSON to the `filename`.
- `--export-markdown `: Export benchmark results as markdown to the `filename`.
- `--verbose`: Print debug logs and Prettier CLI output.**Example:**
```sh
$ ./scripts/benchmark.js \
--baseline ./node_modules/prettier/bin/prettier.cjs \
--runs 5 \
vue
```