Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for production profiles #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zacharyfmarion
Copy link

@zacharyfmarion zacharyfmarion commented Jan 10, 2024

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:

Screenshot 2024-01-09 at 6 52 58 PM

After:

Screenshot 2024-01-09 at 6 53 37 PM

@zacharyfmarion
Copy link
Author

@saphal1998 would you mind taking a look at this when you get a chance?

@saphal1998
Copy link
Collaborator

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 :)

@zacharyfmarion
Copy link
Author

Okay thanks! FYI there is also an ongoing thread here about this change: facebook/hermes#1226 (comment)

@Szymon20000
Copy link

@zacharyfmarion I've added that code to the react-native-release-profiler
margelo/react-native-release-profiler#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants