-
Notifications
You must be signed in to change notification settings - Fork 2k
Reader: improve performance of conversations #21468
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
Conversation
385b915 to
ff11586
Compare
ff11586 to
2ebbc76
Compare
|
Nice one @samouri! I'm seeing some failing tests for the
|
|
The failing test raises an interesting question: what should treeSelect do when dependencies are undefined? |
|
blocked on merge of: #21625 |
5b7b7d0 to
24adbd6
Compare
|
@samouri i'd love to land this. Could you take a look at the failed tests? |
24adbd6 to
ecac717
Compare
|
Failed test should be fixed by #21625 which landed yesterday! |
blowery
left a comment
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.
LGTM! Nice work!
summary
Conversations are dependent upon a single posts's comments and not the entire collection of comments. Therefore the current
createSelectorapproach is less effective than it could be. This PR improves the performance by utilizing treeSelector.I tested for fewer re-renders by using this unmerged performance tool.
below is the result of loading conversations and clicking "more comments" a couple times.
before

after

summary of results
By using
treeSelectinstead ofcreateSelectorI was able to get the wasted render count down from ~351 to 8. These numbers were just after a few second after loading -- I'm sure it would get wayy more drastic if i used conversations for much longer.