benchmark/README.md
Run in the root directory, not ./benchmark
docker build --rm -f Dockerfile.benchmark . --progress plaincargo install hyperfinenpm inode run.jsSetup: MacBook Pro (13-inch, M1, 2020)
xargs -P1dprintThe speed-ups for the multithreaded benchmarks can vary significantly depending on the setup. For example, Rome is 100 times faster than Prettier on an M1 Max with 10 cores.
We've been careful to create fair benchmarks. This section explains some of the decisions behind the benchmark setup and how these decisions affect the results. Please let us know if you have ideas on how to make the benchmarks fairer or if there's a mistake with our setup.
--loglevel=error for a fairer benchmark so that Prettier doesn't print every filename.--max-diagnostics=0 when running Rome because Rome then only counts diagnostics without generating the diffs. Overall, this results in a more accurate comparison but has the downside that Rome only prints the diagnostic count, whereas ESLint prints a line for each lint error.Run time find lib/ examples declarations benchmark -name '*.js' -print0 | xargs -P8 -0 -n 200 npx prettier --write --loglevel=error in the target/webpack directory. I manually tinkered with the -n parameter to get the fastest run. ↩