Improve getEdit() performance a bit #2821
Labels
No labels
backend
critical
defect
duplicate
enhancement
fixed
frontend
general
invalid
major
minor
normal
oxjs
pandora_client
python-ox
task
trivial
wontfix
worksforme
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: 0x2620/pandora#2821
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I (programmatically) made an static edit with 13k clips, and the request times out when I try to watch it :-) so I spent some quality time with a profiler. The vast majority of time is spent JSONifying all the annotations for each clip. I found a couple of easy fixes, patches attached.
With these patches, 98% of time is still spent in Edit.get_layers. Within that:
That 38% in Annotation.json is mostly get_entity():
It's hard to see how to do much better without changing the Annotations schema to have a nullable reference to the entity. Maybe that's one for another time.
Attachment 0001-Edit.json-preload-annotation-users.patch (1600 bytes) added
Attachment 0002-Annotation.json-hard-code-some-field-name-mappings.patch (1549 bytes) added
To support edits that large we might need to introduce pagination in the same way we for lists/find queries.
applied first patch and slightly modified version of second.