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

Don't warn when jsSchedulingOverhead is negative #5731

Closed
wants to merge 1 commit into from

Conversation

corbt
Copy link
Contributor

@corbt corbt commented Feb 3, 2016

This commit modifies the jsSchedulingOverhead warning to only fire if the JS clock is more than 5 seconds ahead of the native clock. This fixes the issue in #1598 for the common case when there's only a minor difference between the two clocks, while still keeping a sanity check if they're extremely off.

cc @nicklockwood @tadeuzagallo

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @sahrens, @nicklockwood and @tadeuzagallo to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Feb 3, 2016
@corbt
Copy link
Contributor Author

corbt commented Feb 11, 2016

We're getting more complaints over at #1598 and this error makes it difficult to debug using Chrome on a device effectively. CC'ing @nicklockwood and @tadeuzagallo again because you were active in that thread, does this PR seem like a reasonable solution?

@facebook-github-bot
Copy link
Contributor

@corbt updated the pull request.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@corbt updated the pull request.

@ide
Copy link
Contributor

ide commented Feb 11, 2016

Another approach would be to infer the clock skew and compensate accordingly.

@corbt
Copy link
Contributor Author

corbt commented Feb 11, 2016

@ide this fix doesn't preclude doing something more sophisticated like that in the future, but it unblocks people who are developing with chrome on a device now.

@ide
Copy link
Contributor

ide commented Feb 11, 2016

yea, not saying your solution is wrong. just throwing an idea out there.

@corbt
Copy link
Contributor Author

corbt commented Feb 11, 2016

Ok cool. 👍

Since I haven't been able to get a code review for this and it's a pretty minor change from the current behavior, I'm going to go ahead and push it tomorrow unless anyone tells me that's a bad idea.

@facebook-github-bot
Copy link
Contributor

@corbt updated the pull request.

@ide
Copy link
Contributor

ide commented Feb 11, 2016

I'm not sure if it's a minor change. Negative skew could be an indicator of something serious... @tadeuzagallo can you take a look at this sometime?

@chetstone
Copy link
Contributor

+1

@tadeuzagallo
Copy link
Contributor

Sorry for taking so long, can you simply delete the warning? It's not really doing anything here other then telling you that you passed a negative value (which works in the web btw).

You could simply delete the whole if and do:

- NSTimeInterval jsSchedulingOverhead = -jsSchedulingTime.timeIntervalSinceNow;
+ NSTimeInterval jsSchedulingOverhead = MAX(-jsSchedulingTime.timeIntervalSinceNow, 0)

@mactive
Copy link

mactive commented Mar 2, 2016

Cool

@corbt corbt force-pushed the jsscheduling-buffer branch from a49677c to 47ade9f Compare March 2, 2016 15:30
@facebook-github-bot
Copy link
Contributor

@corbt updated the pull request.

@corbt corbt force-pushed the jsscheduling-buffer branch from 47ade9f to c73cfa3 Compare March 2, 2016 15:34
@facebook-github-bot
Copy link
Contributor

@corbt updated the pull request.

@corbt
Copy link
Contributor Author

corbt commented Mar 2, 2016

@tadeuzagallo updated and rebased.

@tadeuzagallo
Copy link
Contributor

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are an FB employee go to Phabricator to review.

@ghost ghost closed this in 2d27cf0 Mar 5, 2016
pglotov pushed a commit to pglotov/react-native that referenced this pull request Mar 15, 2016
Summary:This commit modifies the jsSchedulingOverhead warning to only fire if the JS clock is more than 5 seconds ahead of the native clock. This fixes the issue in facebook#1598 for the common case when there's only a minor difference between the two clocks, while still keeping a sanity check if they're extremely off.

cc nicklockwood tadeuzagallo
Closes facebook#5731

Differential Revision: D3014985

Pulled By: tadeuzagallo

fb-gh-sync-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0
shipit-source-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants