-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature flags can be costly when read zillions of times #18004
Comments
I don't know the full reasons why toggling the spaces beta requires the client to restart, but perhaps putting settings watchers on |
The space store isn't running with the flag off so it'll have missed many events and it's easier maintaining the assumption that it'll be given all events it needs and not miss any. Also so the groups store isn't holding onto things |
also the RoomListStore and friends need to be told to recalculate the world, which can be expensive. By the time that you've updated all the stores, the client will have locked up enough where a restart/refresh is less disruptive. |
But for the Spaces beta specifically we can lean into that and read it once and know it won't change in this lifetime - I will do so |
Ah, then nevermind |
Fixed by matrix-org/matrix-react-sdk#8366 |
Some feature flags (such as the one for Spaces) are checked in hot code paths, such as
isRoomVisible
. Every time we check a feature flag, we read it fromlocalStorage
. 😱We should probably cache those feature flags in memory instead.
The text was updated successfully, but these errors were encountered: