Coder Social home page Coder Social logo

react-redux-benchmarks's Introduction

react-redux-benchmarks

Performance benchmark harness for React-Redux

This repo expects that you are using Yarn for package management.

Running benchmarks

yarn initialize
yarn start

After benchmarks have been initialized, you can run with simply:

yarn start

Running specific versions

To specify a single version:

REDUX=5.0.7 yarn start

To specify running against multiple versions:

REDUX=5.0.7:4.4.9 yarn start

To run a specific benchmark:

BENCHMARKS=stockticker yarn start

or specific benchmarks:

BENCHMARKS=stockticker:another yarn start

Setting run length

By default, benchmarks run for 30 seconds. To change this, use

SECONDS=10 yarn start

Adding a benchmark

Benchmarks live in the sources/ directory. Each benchmark must insert this code into index.js:

import 'fps-emit'

In addition, a config-overrides.js must be created with these contents:

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:

  "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:

    <script type="text/javascript" src="redux.min.js"></script>
    <script type="text/javascript" src="react.production.min.js"></script>
    <script type="text/javascript" src="react-dom.production.min.js"></script>
    <script type="text/javascript" src="react-redux.min.js"></script>

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

react-redux-benchmarks's People

Contributors

cellog avatar glenjamin avatar markerikson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.