-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Speed improvements for Input Example #2280
Speed improvements for Input Example #2280
Conversation
Otherwise we keep logging events in all the other Slate Examples, and sometimes hit exceptions on selection change events.
Store JSX row components instead of the data needed to build each row. Limit to showing only the 150 most recent events.
This reverts commit 82e1213.
Codecov Report
@@ Coverage Diff @@
## master #2280 +/- ##
=======================================
Coverage 83.59% 83.59%
=======================================
Files 42 42
Lines 4103 4103
=======================================
Hits 3430 3430
Misses 673 673 Continue to review full report at Codecov.
|
@SmilinBrian Won't limiting the amount of events tracked prevent the Playing locally, one easy win for performance is to change Just an idea, but another improvement might be to use pagination to limit how many items get rendered at a time. Though that is going to start complicating the example. |
Re: the Re: rendering and optimization: Yes, I considered those approaches, but I think |
Storing the pre-instantiated JSX feels weird to me. Can we just limit the list to 50 or 100 and call it a day? |
I think limiting it to 50 would solve the sluggishness and leave the code more obvious. Meanwhile, if you somehow need more than 50 messages, this example is also dumping everything to the console log. |
As of #3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I'm going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding. |
I am finding the Input Tester example very useful while diagnosing issues with composition input. However, once you type for a while things slow down to a crawl as the huge table of logged events gets re-rendered.
Optimize by:
PR includes a change that removes the event listeners when the example is unmounted. While it can sometimes be handy to have input events sent to the console log while typing in other examples, it occasionally throws exceptions on selection events, so it's safer to stop listening.
yarn test
.yarn lint
. (Fix errors withyarn prettier
.)yarn watch
.)