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

Draggable slows down app performance #891

Closed
afandria opened this issue Dec 12, 2015 · 3 comments · Fixed by #895
Closed

Draggable slows down app performance #891

afandria opened this issue Dec 12, 2015 · 3 comments · Fixed by #895
Assignees
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) framework flutter/packages/flutter repository. See also f: labels. waiting for PR to land (fixed) A fix is in flight

Comments

@afandria
Copy link
Contributor

From my observations, a full build is triggered every time I am dragging a Draggable. Instead, I believe that only an onWillAccepting DragTarget's builder should rebuild if the Draggable hovers over it.

I don't think holding a drag without dropping should change any state, so having to rebuild everything is very unexpected. (It's very slow in my app's case, as I have lots of Widgets and images to render.)

I may have made a mistake in my implementation(s), so I'll check with a simpler example. However, if anyone has any ideas on what's causing this, please let me know.

@abarth abarth added the framework flutter/packages/flutter repository. See also f: labels. label Dec 12, 2015
@abarth
Copy link
Contributor

abarth commented Dec 12, 2015

I don't think you're making a mistake. You're hitting this TODO:

https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/overlay.dart#L43

I think the solution here is to replace the KeyedSubtree in the overlay with a stateful widget that can rebuild without triggering a rebuild of the whole app.

/cc @Hixie

@abarth abarth added easy fix c: performance Relates to speed or footprint issues (see "perf:" labels) labels Dec 12, 2015
@Hixie
Copy link
Contributor

Hixie commented Dec 12, 2015

Yeah, that's probably the solution.

@Hixie Hixie self-assigned this Dec 12, 2015
@Hixie Hixie added the waiting for PR to land (fixed) A fix is in flight label Dec 12, 2015
afandria added a commit to vanadium-archive/croupier that referenced this issue Dec 14, 2015
In preparation for the new "with_flutter" manifest, I am updating
Croupier to use that Flutter location (within JIRI_ROOT). This is
good because it's a fixed path.

Also adding "test-unit" target in preparation for the new croupier
test.

Additionally, dragging has become super duper smooth because
of this bugfix: flutter/flutter#891

Change-Id: Ibe1e0c7ff0d1f0fbce0fe3770558347150b66082
@github-actions
Copy link

github-actions bot commented Sep 6, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) framework flutter/packages/flutter repository. See also f: labels. waiting for PR to land (fixed) A fix is in flight
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants