react/scripts/bench
Jan Kassens 6b30832666
Upgrade prettier (#26081)
The old version of prettier we were using didn't support the Flow syntax
to access properties in a type using `SomeType['prop']`. This updates
`prettier` and `rollup-plugin-prettier` to the latest versions.

I added the prettier config `arrowParens: "avoid"` to reduce the diff
size as the default has changed in Prettier 2.0. The largest amount of
changes comes from function expressions now having a space. This doesn't
have an option to preserve the old behavior, so we have to update this.
2023-01-31 08:25:05 -05:00
..
benchmarks Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
.gitignore update the benchmark script (#13994) 2018-11-05 15:55:46 +00:00
README.md Updated scripts and config to replace "master" with "main" branch (#21768) 2021-06-29 14:26:24 -04:00
benchmark.js update the benchmark script (#13994) 2018-11-05 15:55:46 +00:00
build.js Refactor: Reuse variable "remoteRepoDir" (#25740) 2023-01-09 22:59:38 -05:00
package.json Bump minimist from 1.2.0 to 1.2.3 in /scripts/bench (#18500) 2020-04-06 19:29:11 +01:00
runner.js Updated scripts and config to replace "master" with "main" branch (#21768) 2021-06-29 14:26:24 -04:00
server.js Fix a few typos (#10860) 2017-09-27 11:13:21 +01:00
stats.js Update prettier (#13205) 2018-07-17 20:18:34 +01:00
yarn.lock Bump ecstatic from 2.2.1 to 2.2.2 in /scripts/bench (#20468) 2021-06-29 16:53:31 -04:00

README.md

React Benchmarking

Commands

In most cases, the only two commands you might want to use are:

  • yarn start
  • yarn --cwd=../../ build react/index,react-dom/index --type=UMD_PROD && yarn start --skip-build

The first command will run benchmarks with all the default settings. A local and remote build will occur on React and ReactDOM UMD bundles, both local and remote repos will be run against all benchmarks.

The second command will run all benchmarks but skip the build process. This is useful for when doing local performance tweaking and the remote repo has already had its bundles built. Both local and remote repos will be run against all benchmarks with this command too.

The other commands are as follows:

# will compare local repo vs remote merge base repo
yarn start

# will compare local repo vs remote merge base repo
# this can significantly improve bench times due to no build
yarn start --skip-build

# will only build and run local repo against benchmarks (no remote values will be shown)
yarn start --local

# will only build and run remote merge base repo against benchmarks (no local values will be shown)
yarn start --remote

# will only build and run remote main repo against benchmarks
yarn start --remote=main

# same as "yarn start"
yarn start --remote --local

# runs benchmarks with Chrome in headless mode
yarn start --headless

# runs only specific string matching benchmarks
yarn start --benchmark=hacker