Skip to content
프로젝트

Flagsmith/react-native-performance-monitor

GitHub에서 보기

Flagsmith/react-native-performance-monitor has 381 GitHub stars and 15 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-21 04:00 UTC. Last push 2023-03-02.

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
기록 수집 중
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

소개

React Native Performance Monitor - Realtime graphing of React Native render performance

웹 및 앱

README.md

Original

React Native Performance Monitor

This project lets you see a realtime graph of render times within your React Native app. The purpose is for you to be able to create experiments (i.e. change markup and see how it affects render times).

Installation

npm i react-native-performance-monitor --save
npx react-native-performance-monitor get

Usage

import withPerformanceMonitor from 'react-native-performance-monitor/provider';
export default withPerformanceMonitor({WrappedComponent: YourScreen, id: 'Screen Name'});

An example

Set your baseline at http://127.0.0.1:8125/ by clicking remount. Pause the recorder, and adjust your component with what you think will improve performance.

Here's a before and after with this approach

Baseline

<Text style={[this.props.style]}>
    {this.props.children}
</Text>

Improved

<Text style={this.props.style}>
    {this.props.children}
</Text>

With this before and after I observed the following within a large flat list.

Connecting to a real device

In order to connect to a real device you will need to set the IP of your computer, for example:

export default withPerformanceMonitor({ WrappedComponent: AwesomeChat, id: 'AwesomeChat', ip: '192.168.1.10'});

By default the server is listening on port 8125 for event updates and 8126 for websocket. If you need to configure the port, because you are tunneling your request or similar, and or disable the Websocket communication, you can do it like this:

export default withPerformanceMonitor({WrappedComponent: AwesomeChat, id: 'AwesomeChat', ip: '192.168.1.10', events: undefined, showLogs: undefined, port: 80, enableWS: false});

How it works

The overall implementation is quite straight forward and simply involved passing the onRenderCallback values via a websocket server to finally render them in a fancy graph.

There are 3 main components:

  • A React Native component that sends profile data to a server via REST and listens to messages (remount and forceUpdate) to trigger renders.
  • A Web socket server responsible for passing messages between the graph and the react native component
  • A Web application that receives websocket values and renders them to a graph

The following diagram is a brief explanation of the data flow:

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Useful links

Website

Documentation