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.
Description: Install and build a specific version of prettier.
Usage: ./scripts/setup-prettier.sh <directory> <github-reference>
Arguments:
directory
: The prettier installation directory.github-reference
: The github shorthand reference of a prettier repository.
Example:
$ ./scripts/setup-prettier.sh baseline "prettier/prettier#main"
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 <filename>
: The baseline Prettier CLI filename. (required)--target <filename>
: The target Prettier CLI filename.--runs <number>
: Number of iteration to perform for each command. (default:10
)--warmup <number>
: Number of iteration used to warmup the command. (default:1
)--export-json <filename>
: Export benchmark results as JSON to thefilename
.--export-markdown <filename>
: Export benchmark results as markdown to thefilename
.--verbose
: Print debug logs and Prettier CLI output.
Example:
$ ./scripts/benchmark.js \
--baseline ./node_modules/prettier/bin/prettier.cjs \
--runs 5 \
vue