hermes-profile-transformer
hermes-profile-transformer copied to clipboard
Support for production profiles
Adds support for properly symbolicating production profiles taken with hermes. In production mode, hermes produces a slightly different profile format, where instead of line + column information it has funcVirtAddr
and offset
. As far as I can tell you can easily map this back to line and column by doing:
{
line: 1, // always 1 for production hermes builds for now according to metro
column: funcVirtAddr + offset + 1,
}
References:
Profiles taken with react-native-release-profiler. An example profile + sourcemap can be found here.
Demo
Speedscope now has first class support for both the raw and transformed hermes profile formats, it was used for the comparisons:
Before:
After:
@saphal1998 would you mind taking a look at this when you get a chance?
Hey @zacharyfmarion I don't currently have the permission to publish this package, I think @grabbou might be a better person to coordinate this with, but these changes do seem great and thank you so much for raising this PR :)
Okay thanks! FYI there is also an ongoing thread here about this change: https://github.com/facebook/hermes/discussions/1226#discussioncomment-8074520
@zacharyfmarion I've added that code to the react-native-release-profiler https://github.com/margelo/react-native-release-profiler/pull/1