npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-release-profiler

v0.2.1

Published

A fast and simple library to passively profile JS/Hermes performance in production and release builds.

Downloads

11,735

Readme

react-native-release-profiler

A fast and simple library to passively profile JS/Hermes performance in production and release builds.

Why

Usually performance issues are profiled in debug builds, which could lead to false positives (e.g. JS Garbage Collectors, Hermes-specific debug markers, or other LLDB hangs).

react-native-release-profiler allows you to profile your app in release builds, both in a local environment to profile specific issues, as well as in a production environment to spot regressions or collect performance samples from a wider variety of user devices.

Web support

The web support is based on sampling JS Self-Profiling API, so not all browsers support it yet. To see in which browsers it is supported, check this page.

To make it possible to work you'll need to add 'Document-Policy': 'js-profiling' header to your server response. Using webpack in dev mode you can do that by adding these lines to your webpack.config.js:

devServer: {
    headers: {
        'Document-Policy': 'js-profiling',
    },
}

[!WARNING] By default sampling interval is set to 10 milliseconds. This is the lowest supported interval, but on Windows machines this interval will be 16 milliseconds.

Need help?

If you're having performance problems in your app, feel free to reach out to us at [email protected]. We do this a lot. 😉

Installation

yarn add react-native-release-profiler
cd ios && pod install

Usage

  1. Install react-native-release-profiler
  2. Build your app in release mode
  3. Start a profiling session:
    import { startProfiling } from 'react-native-release-profiler'
    
    startProfiling()
  4. Stop the profiling session:
    import { stopProfiling } from 'react-native-release-profiler'
    
    // `true` to save the trace to the phone's downloads folder, `false` otherwise
    const path = await stopProfiling(true)
  5. Download and process the performance trace from your phone to your PC:
    • On Android:
      npx react-native-release-profiler --fromDownload --appId <your appId>
    • On iOS and web:
      npx react-native-release-profiler --local <path to profile>
  6. Open the performance trace in your tool of choice:
    • SpeedScope (https://www.speedscope.app)
    • Perfetto UI (https://ui.perfetto.dev/)
    • Google Chrome's Tracing UI (chrome://tracing)

API

startProfiling(): void

Synchronously starts the Hermes Profiling Session.

stopProfiling(saveInDownloadsDirectory?: boolean, fileName?: string): Promise<string>

Asynchronously stops the Hermes Profiling Session, and saves the file in a cache or downloads directory if saveInDownloadsDirectory is true using the provided fileName (web only).

Returns the path of the saved profile.

Contributing

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

License

MIT