universal-perf
v0.6.5
Published
A universal Perf tools.
Downloads
83
Readme
universal-perf
Install
npm install --save universal-perf
Usage
import {createElement, Component, render} from 'rax';
import {Text} from 'rax-components';
import Perf from 'universal-perf';
class PerfTest extends Component {
render() {
return <Text style={styles.title}>Hello {this.props.name}</Text>;
}
}
const styles = {
title: {
color: '#ff4400',
fontSize: 48,
fontWeight: 'bold',
}
};
Perf.start();
render(<PerfTest name="world" />, null, {
measurer: Perf.Measurer
});
Perf.stop();
let measurements = Perf.getLastMeasurements();
Perf.printInclusive(measurements);
Perf.printExclusive(measurements);
API
Perf.printExclusive
Prints the render time.
Perf.printInclusive
Prints the overall time taken.
Perf.printWasted
Print newly inserted dom nodes in list as a waste of time
Perf.printOperations
Prints operations, eg. "remove attributes" and "change style"