mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
b903ed7940
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52827 Changelog: [internal] This adds **support for creating Hermes/JS sampling profiler traces in Fantom**, which is especially useful when running benchmarks. Usage: ``` FANTOM_PROFILE_JS=1 yarn fantom Animated-benchmark ``` Output: {F1980642216} After this, the trace is fully symbolicated. Can be opened directly in Google Chrome: {F1980642229} Or in the built-in viewer in VSCode: {F1980642242} {F1980642240} {F1980642241} When collapsing frames in the Flame Chart viewer in VSCode, we can quickly identify opportunities for optimizations. This also supports multi-config environments. In that case, trace file names are created using a short representation of the configuration. User guide for benchmarks in Fantom, including how to use this, will be done in a future diff. NOTE: This still doesn't work in OSS because we don't support optimized mode there. In dev mode, there's a segmentation fault coming from this line: `hermesRuntime->sampledTraceToStreamInDevToolsFormat(fileStream)` Reviewed By: sammy-SC Differential Revision: D78905646 fbshipit-source-id: 382ddd5034db601309bd118cedde2fe0d57fde98