{"id":19537438,"url":"https://github.com/margelo/react-native-release-profiler","last_synced_at":"2025-05-15T04:02:35.267Z","repository":{"id":213686324,"uuid":"725710613","full_name":"margelo/react-native-release-profiler","owner":"margelo","description":"📊 A fast and simple library to passively profile JS/Hermes performance in production and release builds.","archived":false,"fork":false,"pushed_at":"2025-04-08T15:34:53.000Z","size":2370,"stargazers_count":246,"open_issues_count":3,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-08T12:15:07.556Z","etag":null,"topics":["debug","debugger","hermes","jsi","perf","performance","production","profiler","profiling","release","sample","trace"],"latest_commit_sha":null,"homepage":"https://margelo.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/margelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-30T18:00:11.000Z","updated_at":"2025-05-05T12:55:59.000Z","dependencies_parsed_at":"2024-01-17T12:26:15.743Z","dependency_job_id":"b23e938d-3c7a-48ed-9e1d-701afd886f94","html_url":"https://github.com/margelo/react-native-release-profiler","commit_stats":{"total_commits":71,"total_committers":4,"mean_commits":17.75,"dds":"0.49295774647887325","last_synced_commit":"80ff24f4ad7354c0b04047ed59e915735b986ea1"},"previous_names":["margelo/react-native-release-profiler"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margelo%2Freact-native-release-profiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margelo%2Freact-native-release-profiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margelo%2Freact-native-release-profiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margelo%2Freact-native-release-profiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/margelo","download_url":"https://codeload.github.com/margelo/react-native-release-profiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270640,"owners_count":22042858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","debugger","hermes","jsi","perf","performance","production","profiler","profiling","release","sample","trace"],"created_at":"2024-11-11T02:27:56.737Z","updated_at":"2025-05-15T04:02:35.212Z","avatar_url":"https://github.com/margelo.png","language":"JavaScript","readme":"\u003ca href=\"https://margelo.io\"\u003e\n  \u003cimg src=\"./img/banner.svg\" width=\"100%\" /\u003e\n\u003c/a\u003e\n\n# react-native-release-profiler\n\nA fast and simple library to passively profile JS/Hermes performance in production and release builds.\n\n## Why\n\nUsually 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).\n\n**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.\n\n## Web support\n\nThe web support is based on sampling [JS Self-Profiling](https://wicg.github.io/js-self-profiling/) API, so not all browsers support it yet. To see in which browsers it is supported, check [this page](https://caniuse.com/mdn-api_profiler).\n\nTo 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`:\n\n```js\ndevServer: {\n    headers: {\n        'Document-Policy': 'js-profiling',\n    },\n}\n```\n\n\u003e [!WARNING]\n\u003e 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.\n\n## Need help?\n\nIf you're having performance problems in your app, feel free to reach out to us at hello@margelo.io. We do this a lot. 😉\n\n## Installation\n\n```sh\nyarn add react-native-release-profiler\ncd ios \u0026\u0026 pod install\n```\n\n### Expo\n\nExpo requires you to also install @react-native-community/cli\n\n```sh\nyarn add --dev @react-native-community/cli\n```\n\n## Usage\n\n1. Install **react-native-release-profiler**\n2. Build your app in release mode\n3. Start a profiling session:\n    ```ts\n    import { startProfiling } from 'react-native-release-profiler'\n\n    startProfiling()\n    ```\n4. Stop the profiling session:\n    ```ts\n    import { stopProfiling } from 'react-native-release-profiler'\n\n    // `true` to save the trace to the phone's downloads folder, `false` otherwise\n    const path = await stopProfiling(true)\n    ```\n5. Download and process the performance trace from your phone to your PC:\n    - On **Android**:\n        ```\n        npx react-native-release-profiler --fromDownload --appId \u003cyour appId\u003e\n        ```\n    - On **iOS** and **web**:\n        ```\n        npx react-native-release-profiler --local \u003cpath to profile\u003e\n        ```\n6. Open the performance trace in your tool of choice:\n    - SpeedScope (https://www.speedscope.app)\n    - Perfetto UI (https://ui.perfetto.dev/)\n    - Google Chrome's Tracing UI ([chrome://tracing](chrome://tracing))\n\n\u003cimg src=\"img/perfetto.png\" /\u003e\n\n\n## API\n\n### `startProfiling(): void`\n\nSynchronously starts the Hermes Profiling Session.\n\n### `stopProfiling(saveInDownloadsDirectory?: boolean, fileName?: string): Promise\u003cstring\u003e`\n\nAsynchronously 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).\n\nReturns the path of the saved profile.\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmargelo%2Freact-native-release-profiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmargelo%2Freact-native-release-profiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmargelo%2Freact-native-release-profiler/lists"}