What is @react-native-firebase/perf?
@react-native-firebase/perf is a performance monitoring library for React Native applications that allows developers to measure the performance of their apps. It provides tools to track the duration of specific tasks, monitor network requests, and gain insights into app performance to help optimize and improve user experience.
What are @react-native-firebase/perf's main functionalities?
Trace Performance
This feature allows you to create custom traces to measure the time taken by specific parts of your application. The code sample demonstrates how to start and stop a custom trace.
import perf from '@react-native-firebase/perf';
async function traceExample() {
const trace = await perf().newTrace('custom_trace');
await trace.start();
// Code you want to trace
await trace.stop();
}
Monitor Network Requests
This feature enables monitoring of network requests to track their performance. The code sample shows how to start and stop an HTTP metric for a network request.
import perf from '@react-native-firebase/perf';
async function monitorNetworkRequest() {
const httpMetric = perf().newHttpMetric('https://example.com', 'GET');
await httpMetric.start();
// Perform network request
await httpMetric.stop();
}
Other packages similar to @react-native-firebase/perf
react-native-performance
react-native-performance is a library that provides tools for measuring and optimizing the performance of React Native applications. It offers similar functionalities to @react-native-firebase/perf, such as tracking render times and monitoring network requests, but it may not be as tightly integrated with Firebase services.

React Native Firebase - Performance Monitoring
Get insights into how your app performs from your users’ point of view, with automatic and customized performance tracing.
> Learn More
Installation
Requires @react-native-firebase/app
to be installed.
yarn add @react-native-firebase/perf
Documentation
Additional Topics
License
Built and maintained with 💛 by Invertase.