fjornF
Convex Community4w ago
3 replies
fjorn

Function execution times out despite trivial implementation

I have a a query that makes 6 database reads all using indexes. Timing it directly with console.time('myFunction'); ... console.timeEnd('myFunction'); shows execution times of ~50ms. Yet I frequently get warnings of execution taking a long time (>850ms) and occasionally even get full timeout errors. My other queries all look correct with reported ~30-50ms execution times.

The only unique thing about this query is its access pattern: it populates the data on card in a "browse" page. So the client will call it 10-30 times in parallel on page load and whenever the user scrolls to load more cards.

One interesting thing I tried was splitting out my files so there was less on the import chain for the file that defined this query. With that I noted the warnings go from ~850ms execution time to ~650ms. But the following day it was back up to >900ms.
Was this page helpful?