-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Performance markers logged from C++ no longer work in Android #23771
Comments
This is what worked for us and the fix is based on what @karanjthakkar mentioned above. With this change in place now all the events are being logged. |
JSIExecutor is used on iOS and Android The change suggested will break on iOS, which cannot depend on Android-specific code. If the address of ReactMarker::logTaggedMarker is inconsistent, there is likely a build error causing the variable to be defined in more than one shared object, which violates the C++ One Definition Rule. I do not know much about gradle, so I can't be of much help changing that. Another strategy would be to pass the LogTaggedMarker instance to JSIExecutor's ctor, instead of using a global, but this would touch a lot more code. |
@mhorowitz Thanks for giving more context. We only have this change for Android so it won't affect the iOS side of things for us but yes we need to find a more platform agnostic fix. Just to understand things a bit better:
Does this mean that the build process internally for FB gets this to work correctly but in OSS its broken in a subtle way? Could you possibly cc someone who would know more about this or have more insight on how would one go about investigating this issue?
If this change were to be done, would you be happy to accept a PR for this? Without a solution that resolves this issue upstream, I'm afraid things are going to get super unmaintainable for us relying on a private fork everytime we upgrade to a new version. |
@mhorowitz I attempted this here: karanjthakkar@98ae572 What are your thoughts? I have tested it and this now works on both Android and iOS. What are your thoughts? |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
This is still pending merge of a fix. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Not stale. Still broken and has an open PR. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
🐛 Bug Report
From 0.58.0 onwards, the four most important perf markers used for measuring RN startup time on Android no longer work:
NATIVE_MODULE_SETUP_START
NATIVE_MODULE_SETUP_END
RUN_JS_BUNDLE_START
RUN_JS_BUNDLE_STOP
This is the commit where the refactor from
JSCExecutor
toJSIExecutor
took place: 749b18dOn further investigation, the reason behind this is the
hasLogger
boolean here never gets a truthy value. This is because the address&ReactMarker::logTaggedMarker
here is different from the one here.If we instead use
JReactMarker::logMarker
here, then the metrics work fine.cc-ing: @mhorowitz and @axe-fb who seem most involved with these changes. @leanmazzu for visibility.
To Reproduce
Init a new RN project on any version above 0.58
Add the following code to start logging markers:
Check logcat. The above mentioned 4 markers won't be logged.
Expected Behavior
It should log the relevant markers.
Code Example
N/A
Environment
The text was updated successfully, but these errors were encountered: