Page MenuHomePhabricator

Caption addition endpoint is slow
Closed, ResolvedPublic

Description

The caption addition endpoint exhibits a surprisingly high latency, even compared to the caption translation endpoint. This needs investigation and remediation.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 12 2019, 4:48 PM

OK, after doing some quick and dirty profiling, I can say with confidence that it's the imageinfo (unstructured captions) query that dominates the latency for both endpoints and regardless of the language(s) requested, and that's killing the performance here. For example, on a single run for /caption/addition/es:

CirrusSearch time: 1504
imageinfo time: 11492
wbgetentities time: 227

Ideally, we'd have a proper in-memory queuing system to support these endpoints, which would eliminate the client-facing latency, but for a variety of reasons that's not really possible at least in the near term. I'd again recommend dropping the unstructured captions from this endpoint, if the app team can live with that.

Mholloway closed this task as Resolved.Jun 22 2019, 11:47 PM

Determined that extmetadata should be dropped for this reason, but querying CirrusSearch will always incur a ~1.5-2 second penalty.