百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-performance-monitor

> 前端框架
开源

React Native 性能监控 - 实时显示 React Native 渲染性能的图表

381 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

React Native 性能监控 - 实时显示 React Native 渲染性能的图表

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

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

Usage

bash
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


    {this.props.children}

Improved


    {this.props.children}

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:

bash
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:

bash
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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptmonitoringperformancereactreact-components

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架