clockworklabs / SpacetimeDB

Multiplayer at the speed of light

Home Page:https://spacetimedb.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cache AST produced by query!

Centril opened this issue · comments

Right now query! always builds & evaluates AST. Since it’s a macro, we can easily expand it into a static variable that will cache AST on the first run so that multiple re-runs will only need to evaluate it but not rebuild it.

UPD: this might be a bit trickier due to variable capture which can change between reruns. It’s still doable but needs a bit of extra work to use DbProgram variables instead of inlining those values.

Closing in favor of #1010.