You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea behind prefetched attachments was that instead of each of our ~530 gdocs fetching all their own (often identical) attachments from the DB and S3 in series, we could prefetch and cache them.
But at the moment we're doing this naively, and selecting ALL the data even though much of it isn't used in any gdoc.
This is especially painful as we prefetch ~6000 charts and ~1100 indicators, which require calls to S3, take upwards of 4 minutes, and frequently time out.
Here's a snippet from a local bake I ran, with some added logging:
Given that we're currently only using linkedIndicators for 8 key-indicators on the homepage, this seems like a grossly counterproductive optimization 😅
I propose that for charts and linkedIndicators, we analyze our gdocs, compute the attachments we need, and only prefetch those. That way we still only have to handle things inside the prefetchAttachments function, but we don't have to worry about it shooting us in the foot if we happen to add a bunch more datapages.
The text was updated successfully, but these errors were encountered:
The idea behind prefetched attachments was that instead of each of our ~530 gdocs fetching all their own (often identical) attachments from the DB and S3 in series, we could prefetch and cache them.
But at the moment we're doing this naively, and selecting ALL the data even though much of it isn't used in any gdoc.
This is especially painful as we prefetch ~6000 charts and ~1100 indicators, which require calls to S3, take upwards of 4 minutes, and frequently time out.
Here's a snippet from a local bake I ran, with some added logging:
Given that we're currently only using
linkedIndicators
for 8 key-indicators on the homepage, this seems like a grossly counterproductive optimization 😅I propose that for
charts
andlinkedIndicators
, we analyze our gdocs, compute the attachments we need, and only prefetch those. That way we still only have to handle things inside the prefetchAttachments function, but we don't have to worry about it shooting us in the foot if we happen to add a bunch more datapages.The text was updated successfully, but these errors were encountered: