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

Bump expiration for interactive updates to 150ms in production #12599

Merged
merged 2 commits into from
Apr 11, 2018

Conversation

flarnie
Copy link
Contributor

@flarnie flarnie commented Apr 10, 2018

what is the change?:
Changes the expiration deadline from 500ms to 150ms, only in production.
In development it will still be 500ms.

I'm thinking we may want to change the 'bucket size' too, will look into
that a bit.

why make this change?:
We need to ensure interactions are responsive enough in order to gather
more test data on async. mode.

Hoping to land and sync this into FB asap.

test plan:
No tests failed - where shall we add a test for this?

**what is the change?:**
Changes the expiration deadline from 500ms to 150ms, only in production.
In development it will still be 500ms.

I'm thinking we may want to change the 'bucket size' too, will look into
that a bit.

**why make this change?:**
We need to ensure interactions are responsive enough in order to gather
more test data on async. mode.

**test plan:**
No tests failed - where shall we add a test for this?
const expirationMs = 500;
let expirationMs;
if (__DEV__) {
// Should complete within ~500ms. 600ms max.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to document the rationale here. It's because relying on expiration is an indicator that you could've been doing better and you should see that opportunity during dev.

In prod, it's better to opt for slightly better UX if you fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - will update the comment.

@flarnie
Copy link
Contributor Author

flarnie commented Apr 10, 2018

It looks like the 'bucket size' just allows us to 'bucket' updates into expiration times, so if we have the following times:

-----x----x--x-----x-----x---x----x-x-xxx-----x-----

Then the bucketing just groups them like so:

+--------------+ +--------------+ +--------------+
|--------------| |--------------| |--------------|
-----x----x--x--+--x-----x---x----x-x-xxx-----x---+-
                ^                ^                ^
                |                |                |
                +                +                +
     expires here     expires here     expires here

That should work the same way whether they expire in 150ms or 500ms.

I also don't think we need a test for this right now - ideally we are not relying too much on expiration.

@flarnie flarnie merged commit 915bb53 into facebook:master Apr 11, 2018
rhagigi pushed a commit to rhagigi/react that referenced this pull request Apr 19, 2018
…ook#12599)

* Bump expiration for interactive updates to 150ms in production

**what is the change?:**
Changes the expiration deadline from 500ms to 150ms, only in production.
In development it will still be 500ms.

I'm thinking we may want to change the 'bucket size' too, will look into
that a bit.

**why make this change?:**
We need to ensure interactions are responsive enough in order to gather
more test data on async. mode.

**test plan:**
No tests failed - where shall we add a test for this?

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

Successfully merging this pull request may close these issues.

4 participants