All Projects → Rowno → react-benchmark

Rowno / react-benchmark

Licence: ISC license
A tool for benchmarking the render performance of React components

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to react-benchmark

hashcat-benchmark-comparison
Hashcat Benchmark Comparison
Stars: ✭ 22 (-77.78%)
Mutual labels:  benchmark
hood
The plugin to manage benchmarks on your CI
Stars: ✭ 17 (-82.83%)
Mutual labels:  benchmark
caliper-benchmarks
Sample benchmark files for Hyperledger Caliper https://wiki.hyperledger.org/display/caliper
Stars: ✭ 69 (-30.3%)
Mutual labels:  benchmark
gpumembench
A GPU benchmark suite for assessing on-chip GPU memory bandwidth
Stars: ✭ 62 (-37.37%)
Mutual labels:  benchmark
beapi-bench
Tool for benchmarking apis. Uses ApacheBench(ab) to generate data and gnuplot for graphing. Adding new features almost daily
Stars: ✭ 16 (-83.84%)
Mutual labels:  benchmark
cpm
Continuous Perfomance Monitor (CPM) for C++ code
Stars: ✭ 39 (-60.61%)
Mutual labels:  benchmark
benchmarkjs-pretty
Tiny wrapper around benchmarkjs with a nicer api
Stars: ✭ 20 (-79.8%)
Mutual labels:  benchmark
sets
Benchmarks for set data structures: hash sets, dawg's, bloom filters, etc.
Stars: ✭ 20 (-79.8%)
Mutual labels:  benchmark
nowplaying-RS-Music-Reco-FM
#nowplaying-RS: Music Recommendation using Factorization Machines
Stars: ✭ 23 (-76.77%)
Mutual labels:  benchmark
typescript-orm-benchmark
⚖️ ORM benchmarking for Node.js applications written in TypeScript
Stars: ✭ 106 (+7.07%)
Mutual labels:  benchmark
LuaJIT-Benchmarks
LuaJIT Benchmark tests
Stars: ✭ 20 (-79.8%)
Mutual labels:  benchmark
glDelegateBenchmark
quick and dirty benchmark for TFLite gles delegate on iOS
Stars: ✭ 13 (-86.87%)
Mutual labels:  benchmark
Face-Renovation
Official repository of the paper "HiFaceGAN: Face Renovation via Collaborative Suppression and Replenishment".
Stars: ✭ 245 (+147.47%)
Mutual labels:  benchmark
TensorTrade
This repository hosts all my code related to TensorTrade. It consists of the main program, its old versions, and some extras for more insights.
Stars: ✭ 16 (-83.84%)
Mutual labels:  benchmark
benchmarking-fft
choosing FFT library...
Stars: ✭ 74 (-25.25%)
Mutual labels:  benchmark
embeddings
Embeddings: State-of-the-art Text Representations for Natural Language Processing tasks, an initial version of library focus on the Polish Language
Stars: ✭ 27 (-72.73%)
Mutual labels:  benchmark
graphql-benchmarks
GraphQL benchmarks using the-benchmarker framework.
Stars: ✭ 54 (-45.45%)
Mutual labels:  benchmark
httpit
A rapid http(s) benchmark tool written in Go
Stars: ✭ 156 (+57.58%)
Mutual labels:  benchmark
revl
Helps to benchmark code for Autodesk Maya.
Stars: ✭ 14 (-85.86%)
Mutual labels:  benchmark
node-vs-ruby-io
Node vs Ruby I/O benchmarks when resizing images with libvips.
Stars: ✭ 11 (-88.89%)
Mutual labels:  benchmark

react-benchmark

Demo

A tool for benchmarking the render performance of React components.

It compiles the benchmark code into a minified production bundle using Webpack and then runs it in headless Chrome to benchmark the real production code in a real production environment.

Note: the benchmark numbers aren՚t completely accurate and should only be used relatively to compare the performance difference of code changes or different implementations.

Install

yarn global add react-benchmark
# or
npm install -g react-benchmark

Usage

Usage
  $ react-benchmark <path>

Options
  <path>          Path to a JavaScript or TypeScript file that exports the function to be benchmarked.
  --debug, -d     Run a development build instead of a production build to aid debugging.
  --devtools, -t  Run Chrome in windowed mode with the devtools open.
  --cpuThrottle=X Run Chrome with CPU throttled X times.
  --version       Prints the version.
  --help          Prints this message.

Examples
  $ react-benchmark benchmark.js

The <path> file should export a function that returns the component instance you want to benchmark. For example:

import React from 'react'
import Component from './src'

export default function () {
  return <Component hello="world" />
}

You can import anything that Webpack supports out of the box and your code will be transpiled with Babel using your local Babel config. TypeScript files are also supported out of the box.

API

react-benchmark exports a ReactBenchmark class that instantiates an event emitter with a .run() method. Calling the .run() method will start the benchmark with the provided options.

const ReactBenchmark = require('react-benchmark')
const reactBenchmark = new ReactBenchmark()

reactBenchmark.on('progress', (currentStats) => {
  console.log(currentStats)
})

const result = await reactBenchmark.run('benchmark.js')

See the CLI code for a full implementation example.

.run(filepath, options)

Starts the benchmark. Returns a Promise that will resolve to a Benchmark object containing the stats once the benchmark has been completed.

filepath

Type: String

Path to the benchmark file to run. See the Usage section for more details.

options

Type: Object Default: { debug: false, devtools: false, cpuThrottle: 1 }

Optional object containing additional options.

debug

Type: Boolean
Default: false

Run a development build instead of a production build to aid debugging.

devtools

Type: Boolean
Default: false

Run Chrome in windowed mode with the devtools open.

cpuThrottle

Type: number
Default: 1

Run Chrome with CPU throttled X times. Useful to receive more precise results between runs.

Events

webpack

Fired when the Webpack build has started.

server

Fired when the webserver has started.

chrome

Fired when Chrome has launched.

start

Fired when the actual benchmark starts.

progress

Fired every time a benchmark cycle has been completed. Gets passed a Benchmark object with the current stats. This event will be fired multiple times per run.

console

Fired every time something is logged to Chrome՚s console. Gets passed a {type, text} object.

License

react-benchmark is released under the ISC license.

Copyright © 2018, Roland Warmerdam.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].