Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

react-native-release-profiler

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-release-profiler

Use Hermes profiler even in release builds

Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
214K
-11.81%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-release-profiler

Finally a reliable way to profile our apps. No more false-positives or findings issues that are only present in debug build. In Debug builds (even when you use release bundle) a lot of things can take much more time than it actually takes on production. For instance garbage collection or JSI calls. Because of that every thing we find slow using hermes profiler has to be verified using release build. With this library you can run hermes profiler using release builds which simplifies the whole process. Additionally you can use the library on production to let the most challening users send you performance profiles.

Need some help with performance issues?

If have any problems with performance feel free to reach out to us at hello@margelo.io.

Installation

npm install react-native-release-profiler 
or
yarn add react-native-release-profiler

Usage (Android)

  • Install the library yarn add react-native-release-profiler
  • Build the app in release mode
  • start profling
    import { startProfiling } from 'react-native-release-profiler';
    
    startProfiling()
    
  • stop profiling
    import { stopProfiling } from 'react-native-release-profiler';
    
    stopProfiling(true)
    
  • Fetch and process the profile npx react-native-release-profiler --fromDownload --appId [your appId]
  • Open the profile in chrome://tracing

Usage (iOS)

  • Install the library yarn add react-native-release-profiler
  • Build the app in release mode
  • start profling
    import { startProfiling } from 'react-native-release-profiler';
    
    startProfiling()
    
  • stop profiling and keep the path
    import { stopProfiling } from 'react-native-release-profiler';
    
    const path = stopProfiling(true)
    
  • Send file from phone to your mac through AirDrop
    import Share from 'react-native-share';
    const path = await stopProfiling(true)
    const actualPath = `file://${path}`;
    Share.open({
        url: actualPath
    })
    .then((res) => {
        console.log(res);
    })
    .catch((err) => {
        err && console.log(err);
    });
    
  • process the profile npx react-native-release-profiler --local <path to profile>
  • Open the profile in chrome://tracing

API

  • startProfiling() - synchronously starts hermes profiler

  • stopProfiling(saveInDownloadsDirectory: boolean): Promise<string> - stops profiling and saves file in cache or downloads directory.

    • returns the path under which the profile has been saved

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Made with create-react-native-library

Keywords

react-native

FAQs

Package last updated on 19 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts