#Latency overhead when wrapping component functions

4 messages · Page 1 of 1 (latest)

inner mortar
#

I'm curious to understand the latency between the following function-to-function calls:

  1. Query/mutation to query/mutation
  2. Action to query/mutation
  3. Action to action

Empirically this has been significant enough (~50ms) to consider copy pasting code from the components in publicly facing queries instead of wrapping them, but then the issue is that my app doesn't recognize the component tables, e.g. "messages" for the agent component.

The ideal case ofc is that there's no overhead when calling a function from a function. A little birdie told me that substantial improvements are coming to this, so I'd love to hear more from the Convex team convex

Tagging @plucky flame

inner mortar
#

Also, depending on this, we'd use ctx.runQuery or use helpers that directly use ctx.db (which I assume is ultra fast)

covert cloak
#

yep, we're working on optimizing cross-component calls

inner mortar
#

Nice, but just to be clear, is this overhead only there when calling a component function from our app function or is it also there if i call ctx.runQuery inside another query vs directly ctx.db.query ?