Open Bug 1411852 Opened 7 years ago Updated 2 years ago

All react components updated when new request is received

Categories

(DevTools :: Netmonitor, defect, P3)

defect

Tracking

(firefox57 fix-optional)

Tracking Status
firefox57 --- fix-optional

People

(Reporter: gasolin, Unassigned)

References

Details

Attachments

(1 file)

Running react devtool and spot all components updated when new request is received.

http://recordit.co/xbpnoZQVbN

Some of them are unnecessary update, ex:

* Toolbar should not get updated while add new request
* Existing requests should not get updated (except the timeline part) as well while add new request
Depends on: 1411855
Note react-devtools described the highlight is not accurate before v16
https://github.com/facebook/react-devtools#does-highlight-updates-trace-renders

So this might not a valid issue, since todomvc demo looks like have similar issue http://todomvc.com/examples/react/#/
This patch seems to reduce the number of updates on the Toolbar component for me.
Seems selector/getRequestFilterTypes is not cached by reselect, it could be moved to utils/ or called directly without extra function.
Blocks: 1350969
also saw the `Warning: Toolbar.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false` in console

removed the line `this.refs.searchbox.focused;` fix the warning
can use `this.refs.searchbox && this.refs.searchbox.focused`
After patch toolbar without Searchbox shouldComponentUpdate, the result still looks good for netmonitor

simple.netmonitor.open 535.19 > 519.69 -2.90% (low) 
damp simple.netmonitor.reload 79.50 > 75.49 -5.05% (med)

https://treeherder.mozilla.org/perf.html#/comparesubtest?originalProject=mozilla-central&newProject=try&newRevision=d4b7a5b6fce8d3a8cfefe7da39a9f6be7b029173&originalSignature=edaec66500db21d37602c99daa61ac983f21a6ac&newSignature=edaec66500db21d37602c99daa61ac983f21a6ac&framework=1&selectedTimeRange=172800
@Fred: what about this patch, should we review/land it?

Honza
Flags: needinfo?(gasolin)
I suggest to modify this patch a bit then try to land it

1. remove Searchbox shouldComponentUpdate so this patch won't affect other modules perf
2. remove selector/getRequestFilterTypes & modify netmonitor/src/middleware/prefs.js as this patch

ntim, could you help update the patch?
Flags: needinfo?(gasolin) → needinfo?(ntim.bugs)
Depends on: 1416194
Flags: needinfo?(ntim.bugs)
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: