Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Slice flush into small parts #415

Merged
merged 2 commits into from
Aug 25, 2016
Merged

Slice flush into small parts #415

merged 2 commits into from
Aug 25, 2016

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Aug 19, 2016

This is a proof of concept of slicing flush into small parts.
React DevTools currently heavily slow down big apps like (PE) with all the synchronous work.

Example before:

screen shot 2016-08-19 at 18 30 18

Example after:

screen shot 2016-08-19 at 18 28 49

@jaredly
Copy link
Contributor

jaredly commented Aug 25, 2016

this is awesome. Does it get super behind though?

@gaearon
Copy link
Contributor Author

gaearon commented Aug 25, 2016

In my testing it gets behind by a few seconds if you're doing heavy operations (e.g. unmount/mount a FixedDataTable multiple times without giving it time to breathe).

For React Motion-like demos with tons of fast updates, it gets behind by about half a second so it’s “trailing” updates at a slower speed.

It’s a bit hard for me to say if this is confusing or not unless we let people use this, and wait for complaints.

@@ -197,34 +214,45 @@ class Bridge {
this._inspectables.set(id, {...prev, ...data});
}

sendOne(evt: string, data: any) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one seems dead, I couldn’t find calls to it anywhere.

@ghost ghost added the CLA Signed label Aug 25, 2016
@jaredly
Copy link
Contributor

jaredly commented Aug 25, 2016

I'd love for there to be an indicator that we're lagging, to reduce confusion. maybe add a flag to "send-many" indicating how many evens we still have to send. Then in the UI we could show a loading indicator if that number gets above 100 or something.

That doesn't have to be part of this diff though

@gaearon gaearon merged commit bf2601e into facebook:master Aug 25, 2016
@gaearon
Copy link
Contributor Author

gaearon commented Aug 25, 2016

I did some tweaks to better handle real world scenarios, now it’s consistent pretty fast even with large number of events so I think maybe we don’t need an indicator.

jhen0409 added a commit to jhen0409/react-devtools that referenced this pull request Feb 7, 2017
pastelsky pushed a commit to pastelsky/react-devtools that referenced this pull request Feb 18, 2017
* Slice flush into small parts

* Schedule in a smarter way
pastelsky pushed a commit to pastelsky/react-devtools that referenced this pull request Feb 25, 2017
* Slice flush into small parts

* Schedule in a smarter way
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants