https://github.com/aslemammad/react-state-benchmarks
Performance benchmark harness for React-Redux
https://github.com/aslemammad/react-state-benchmarks
Last synced: 9 months ago
JSON representation
Performance benchmark harness for React-Redux
- Host: GitHub
- URL: https://github.com/aslemammad/react-state-benchmarks
- Owner: Aslemammad
- License: mit
- Fork: true (dai-shi/react-redux-benchmarks)
- Created: 2021-05-25T07:08:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-30T13:11:32.000Z (about 5 years ago)
- Last Synced: 2025-01-22T09:32:10.917Z (over 1 year ago)
- Language: JavaScript
- Size: 1.66 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-redux-benchmarks
Performance benchmark harness for React-Redux
This repo expects that you are using Yarn for package management.
# Running benchmarks
```bash
yarn initialize
yarn start
```
After benchmarks have been initialized, you can run with simply:
```bash
yarn start
```
## Running specific versions
To specify a single version:
```bash
REDUX=5.0.7 yarn start
```
To specify running against multiple versions:
```bash
REDUX=5.0.7:4.4.9 yarn start
```
To run a specific benchmark:
```bash
BENCHMARKS=stockticker yarn start
```
or specific benchmarks:
```bash
BENCHMARKS=stockticker:another yarn start
```
## Setting run length
By default, benchmarks run for 30 seconds. To change this, use
```bash
SECONDS=10 yarn start
```
# Adding a benchmark
Benchmarks live in the `sources/` directory. Each benchmark must insert this
code into `index.js`:
```js
import 'fps-emit'
```
In addition, a `config-overrides.js` must be created with these contents:
```js
module.exports = function override(config, env) {
//do stuff with the webpack config...
console.log(`Environment: ${env}`)
if(env === "production") {
config.externals = {
"react" : "React",
"redux" : "Redux",
"react-redux" : "ReactRedux",
}
}
return config;
}
```
and the scripts section of `package.json` should be changed to:
```json
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired --env=jsdom",
...
}
```
Also, `index.html` must be modified to include these lines:
```html
```
If you need to make changes to the `fps-emit` package, bump the version number in its `package.json`,
then update each benchmark to use the newest version using `yarn upgrade-interactive` and selecting `fps-emit`
for an update. Then rebuild all the benchmarks using `yarn initialize`