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

Performance issue when deleting objects #1972

Closed
bjorn opened this Issue Jul 9, 2018 · 1 comment

Comments

1 participant
@bjorn
Owner

bjorn commented Jul 9, 2018

When deleting hundreds of objects there is a significant pause (when it's a thousand objects, Tiled even hangs for a long time). Undoing and redoing this action is fast however. It is strange that the initial action takes so long, so this should be investigated.

@bjorn

This comment has been minimized.

Owner

bjorn commented Jul 13, 2018

It is strange that the initial action takes so long, so this should be investigated.

This is because it only happens when the objects that are being removed are selected.

The problem is that each object is removed individually, which causes a change to the set of selected objects, and in response to each such change a lot of code is executed in the Objects view (synchronizing the selection) and the main map view (like recomputing resize handle positions).

So a possible fix is to explicitly deselect all objects that are going to be removed first, such that there is only one change to the selection. But that does not work when the change is later redone after the objects are selected again. The real fix probably requires the use of a single undo command that can remove / restore multiple objects.

@bjorn bjorn closed this in 36cdc60 Jul 13, 2018

@bjorn bjorn added this to Recently Completed in Roadmap via automation Jul 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment