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

improved handleStart perf #239

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jakedowns
Copy link

small tweak: moved .sorting to a local property instead of a this.setState call
could make an immutable scoped var or something, but this works for now.


I was experiencing some lag on .handleStart due to the setState call on the container
(~30ms with 57 items / ~165ms with 351 items)

by moving this field to a class-level property, rather than Component.state, handleStart now executes in ~1-5ms for me (even with 350 items)

moved .sorting to a local property instead of a this.setState call
could make an immutable scoped var or something, but this works for now
@jakedowns jakedowns changed the title improve handleStart lag by removing unnecessary update/render cycle improved handleStart perf Jul 9, 2017
@matthewk
Copy link

I have an issue with the current sortable HOC that I believe would be fixed by this, is there anything stopping this from being merged?

redking added a commit to DataDog/react-sortable-hoc that referenced this pull request Oct 23, 2018
…-hoc - remove state changes to improve handleStart perf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants