clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.3k stars 106 forks source link

Queries should operate on borrowed product values #998

Closed joshua-spacetime closed 5 months ago

joshua-spacetime commented 5 months ago

Image

Right now we clone product values for incremental queries, even ones without any mutative operations like projections. This is because each execution plan owns its delta tables, and each delta table in turn owns its product values. However there's no need for an execution plan to own the delta values that it operates on, unless it must construct new values as is the case for projections.

In the profile above, these clones account for roughly 20-25% of the evaluation of incremental table selects.

joshua-spacetime commented 5 months ago

Closed by #1019