SpacetimeDB
SpacetimeDB copied to clipboard
Pass `ReducerContext` earlier by reference
We pass the ctx: ReducerContext by move in __call_reducer__ and in a few hops before we actually reach reducer.invoke(&ctx, args) where it's finally passed by reference. However, size_of_val(&ctx) is 400, mainly due to rng, so this will likely result in memcpy rather than passing in registers. Avoid this by immediately passing ctx by reference in __call_reducer__.