Closed xiyler closed 6 months ago
Rejected, since Centrals solve the problem of state centralization/packing better in relation to how the library itself work than Selects do.
Central's RFC: https://github.com/vinum-team/rfc/blob/main/rfcs/utility-central.md
It could be worthwhile to conditionally memoize Selects, as this could allow for decreased memory consumption and performance gains in an example like so:
While this is a generally good optimization, we may want to instead rework how Operators deal with state structs that compute/hold luau tables. Should we instead provide utility functions that mutate tables so that you could call a Write call like this:
This all points to the elephant in the room, which is state centralization. While Selects (and perhaps functions like Mutate) generally make dealing with state centralization easier, they don't just optimize it well.
This is technically tied with how GNRA operates. It prepares the final queue without accounting for whether the actual state object will change its value or not (this can be predicted when given the same input to its dependencies), so we may end up with unnecessary updates when updating
Store
naively.