-
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
Fix broken perf marker logging for RN > 0.58 on Android #23851
Conversation
The intention of this PR is not to be a final solution but to allow someone from FB to import this internally and see if it causes any regressions. |
5d7931c
to
1aad713
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axe-fb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
1aad713
to
e5ab170
Compare
@axe-fb Do you have any updates from the result of importing this internally? There was a merge conflict that occurred from a recent change to master that I have now fixed as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axe-fb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@karanjthakkar - I imported it internally, and looks like there are a ton of apps internally that use the old signature to initialize the JSC factory, causing compilation errors. Need to see if there is a way to change them all, or not add a new param to the constructor. A side question - can this instead be a C++ module, instead of passing it in the constructor ? |
@axe-fb I don't know what you mean by this. I'm not super well versed with the C++ architecture of RN. Do you have an example?
The constructor technique was something Ben suggested in the original issue. I did not know internally folks create different JSC Factory. What is the usecase for that? Would overloading the constructor to allow zero arguments help? Essentially I just want the metrics to work like they did before. There are already plans in place for v0.60 whereas this has been broken since v0.58. I'm happy to do whatever changes you think are appropriate to get this resolved. As you can see this has been sitting for quite some time and at some point it would get too difficult for me to resolve the conflicts that come from continuous updates to master. Its super unfortunate that this bug wasn't caught because they depend on different build systems for OSS and FB. |
e5ab170
to
a9c94b3
Compare
@@ -19,6 +20,7 @@ namespace { | |||
|
|||
class JSCExecutorFactory : public JSExecutorFactory { | |||
public: | |||
JSCExecutorFactory(ReactMarker::LogTaggedMarker logTaggedMarker) : logTaggedMarker_(logTaggedMarker) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSCExecutorFactory(ReactMarker::LogTaggedMarker logTaggedMarker) : logTaggedMarker_(logTaggedMarker) {} | |
JSCExecutorFactory() { logTaggedMarker_ = nullptr; } | |
JSCExecutorFactory(ReactMarker::LogTaggedMarker logTaggedMarker) : logTaggedMarker_(logTaggedMarker) {} |
@axe-fb Maybe something like this? Assuming the other instances of JSC factory that you are talking about don't need marker logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I was thinking we could have a second constructor, which would be hte original signature and hence existing apps will not break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axe-fb I can make that change but I wonder if that would be enough. This change would not break those features but again it will swallow any marker logs from the features because the logger won't be available. Do you think that would create any problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axe-fb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
FYI, |
@axe-fb @mhorowitz Do you folks have any update here? Anything I can do to get this to resolution faster? |
React/CxxBridge/RCTCxxBridge.mm
Outdated
@@ -112,9 +112,9 @@ static void notifyAboutModuleSetup(RCTPerformanceLogger *performanceLogger, cons | |||
} | |||
} | |||
|
|||
static void registerPerformanceLoggerHooks(RCTPerformanceLogger *performanceLogger) { | |||
static ReactMarker::LogTaggedMarker registerPerformanceLoggerHooks(RCTPerformanceLogger *performanceLogger) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment from @mhorowitz
This is also a strange name, since it's not "registering" anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made it getPerformanceLoggerHooks
now. Let me know if that's okay.
8d1a7a6
to
319d2da
Compare
@@ -15,6 +15,10 @@ namespace react { | |||
|
|||
class JSCExecutorFactory : public JSExecutorFactory { | |||
public: | |||
explicit JSCExecutorFactory( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is needed to make the RNTester turbo module example work.
319d2da
to
661c827
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axe-fb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@axe-fb Do you have any updates here? Did the internal tests pass? |
Sorry, did not mean change the constructor of JSCExecutor. Meant change JSIExecutor. Never mind though. I have made the changes, and am now trying to get it building internally. |
So internal tests succeed, but OSS tests are failing !!
now working on fixing those !! This is indeed a game of whack-a-mole !! But atleast, we have good tests to catch these !! |
Yay! That's great! If you could push the commit here that you did to fix internal tests, I can try to look into why the oss tests are failing. |
Update: I fixed all internal and OSS tests, so I think we should be good. I am now waiting for internal code review now, since the commit now has grown to touch a lot more files now. |
@axe-fb Thanks for the update! Look forward to seeing this resolved! |
@axe-fb Any update here? 🙂 |
Summary
Fixes #23771
Changelog
[Android] [Fixed] - Fix broken perf marker logging for RN > 0.58 on Android
Test Plan
The relevant markers are now logged whenever you initialise RN bridge.