Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jondot/react-native-slowlog
A high-performance timer based profiler for React Native that helps you track big performance problems.
https://github.com/jondot/react-native-slowlog
debugging infrastructure performance react-native tools
Last synced: 3 days ago
JSON representation
A high-performance timer based profiler for React Native that helps you track big performance problems.
- Host: GitHub
- URL: https://github.com/jondot/react-native-slowlog
- Owner: jondot
- Created: 2016-05-01T07:43:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-08T09:40:43.000Z (almost 8 years ago)
- Last Synced: 2025-01-01T18:12:31.057Z (10 days ago)
- Topics: debugging, infrastructure, performance, react-native, tools
- Language: JavaScript
- Homepage:
- Size: 112 KB
- Stars: 376
- Watchers: 5
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-react-native - react-native-slowlog ★271 - A high-performance timer based profiler for React Native that helps you track big performance problems (Components / Utils & Infra)
- awesome-react-native - react-native-slowlog ★271 - A high-performance timer based profiler for React Native that helps you track big performance problems (Components / Utils & Infra)
- awesome-react-native - react-native-slowlog ★271 - A high-performance timer based profiler for React Native that helps you track big performance problems (Components / Utils & Infra)
- awesome-react-native-ui - react-native-slowlog ★55 - A high-performance timer based profiler for React Native that helps you track big performance problems (Components / Utils & Infra)
- awesome-react-native - react-native-slowlog ★271 - A high-performance timer based profiler for React Native that helps you track big performance problems (Components / Utils & Infra)
README
# Slowlog
A high-performance timer for React Native that helps you track big performance problems.
Use it as a first line of defense, before tools like system trace and perftools.![](shot.png)
## Quickstart
In your React Native project run:
`$ npm i -S react-native-slowlog`
This is added as a runtime dependency, and `slowlog` will only run in developer mode (using the `__DEV__` flag).
To use `slowlog` apply it to your component this way:
```javascript
class Master extends Component {
constructor(props){
super(props)
slowlog(this, /.*/)this.state = this.getDataSource(props)
this.shouldComponentUpdate = shouldComponentUpdate.bind(this)
}
...
}
```## Options
You can apply `slowlog` differently based on your needs:
```javascript
slowlog([this], [regex matching methods], { verbose: false, threshold: 16, log: console, excludes: [dict of excluded methods] })
```* `verbose` - will output all timing information to console, and just slow operations to yellowbox
* `threshold` - in milliseconds. Anything above that goes to yellowbox
* `log` - a `console`-like object. Anything that responds to `.log([msg])` and `.warn([msg])`
* `excludes` - a dict containing an exclusion list, like so {foobar:true, constructor:true} and so on. If you change this, remember to always
include `constructor`# Contributing
Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).
# Copyright
Copyright (c) 2016 [Dotan Nahum](http://gplus.to/dotan) [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.