editEntity times out if there are many annotations for the entity #2827

Closed
opened 2015-09-02 12:28:24 +00:00 by wjt · 5 comments

Entity.save() updates all annotations for that entity in case its name has changed. This is slow if there are many annotations for the entity: for example, updating ~1.7k annotations for an entity takes around 7 minutes. editEntity times out long before that point!

Patch to follow to move updating all the annotations into an async task as a quick fix to make the UI responsive. It's still not great that this is so expensive. It would be nice to only refresh the annotations if the name has actually changed. It would be even nice to do that more cheaply! Annotations.objects.filter(...).update(findvalue=..., ...) is of course way faster but doesn't update the clips…

Entity.save() updates all annotations for that entity in case its name has changed. This is slow if there are many annotations for the entity: for example, updating ~1.7k annotations for an entity takes around 7 minutes. editEntity times out long before that point! Patch to follow to move updating all the annotations into an async task as a quick fix to make the UI responsive. It's still not great that this is so expensive. It would be nice to only refresh the annotations if the name has actually changed. It would be even nice to do that more cheaply! `Annotations.objects.filter(...).update(findvalue=..., ...)` is of course way faster but doesn't update the clips…
wjt added the
backend
label 2015-09-02 12:28:24 +00:00
wjt added this to the 14.04 milestone 2015-09-02 12:28:24 +00:00
j was assigned by wjt 2015-09-02 12:28:24 +00:00
wjt added the
normal
defect
labels 2015-09-02 12:28:24 +00:00
Author

Attachment 0001-Entity.save-update-annotations-async-fixes-2827-kind.patch (2035 bytes) added

**Attachment** 0001-Entity.save-update-annotations-async-fixes-2827-kind.patch (2035 bytes) added
Author

In [pandora,5014]changeset:"pandora,5014":

#!CommitTicketReference repository="" revision="pandora,5014"
Entity.save(): update annotations async (fixes #2827, kinda)
In [pandora,5014]changeset:"pandora,5014": ``` #!CommitTicketReference repository="" revision="pandora,5014" Entity.save(): update annotations async (fixes #2827, kinda) ```
wjt added the
fixed
label 2015-09-02 12:33:01 +00:00
wjt closed this issue 2015-09-02 12:33:01 +00:00
Owner

yes would be nicer to do more targeted updates. but async should be mostly ok

yes would be nicer to do more targeted updates. but async should be mostly ok
Author

Thanks! Let's see if this turns out okay in practice, and if not I can take another look…

Thanks! Let's see if this turns out okay in practice, and if not I can take another look…
Owner

In 691b3fa9/pandora:

#!CommitTicketReference repository="pandora" revision="691b3fa9346ff8488a65017ec223239682394811"
Entity: only update annotations when name has changed (fixes #2877)

Just like ace0468 this doesn't exactly fix #2827, but it does reduce the
unnecessary work.
In [691b3fa9/pandora](https://code.0x2620.org/0x2620/pandora/commit/691b3fa9346ff8488a65017ec223239682394811): ``` #!CommitTicketReference repository="pandora" revision="691b3fa9346ff8488a65017ec223239682394811" Entity: only update annotations when name has changed (fixes #2877) Just like ace0468 this doesn't exactly fix #2827, but it does reduce the unnecessary work. ```
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: 0x2620/pandora#2827
No description provided.