Skip to content
项目

jondot/react-native-slowlog

在 GitHub 查看

关于

A high-performance timer based profiler for React Native that helps you track big performance problems.

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

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.

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:

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:

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 @jondot. See LICENSE for further details.

探索相关项目

加载中…