-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Proposal: Allow multiple aggregate.at
calls on the same aggregate to be carried out in the same environment.
Background: Currently, each call to an aggregate/a component spins up an independent v8-isolate environment (as per Ian's statement in Discord). This means that calling aggregate.at
multiple times can lead to very slow execution speeds.
Example:
In our production app, for example, the code below takes ~800 ms on a TableAggregate of approx 10,000 documents (measured by console.time
):
const indexes = [0, 1, ..., 30] // array of length = 30
const atIndexes = await Promise.all(
indexes.map((i) => profileSubmissionAggregate.at(ctx, i)),
);
Note: the code above is taken from the shuffle example in the Aggregate docs: https://github.com/get-convex/aggregate/blob/main/example/convex/shuffle.ts
Metadata
Metadata
Assignees
Labels
No labels