Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Demonstration of potential memberlist optimizations.
This is to show posssible optimizations on the memberlist receive path. I believe both these are correct but I need to spend a little time more double checking. All unit tests pass with both these optimizations. 1) Remove Clone()-ing `ring.Desc` The state is cloned so that when the state is not changed, it is not put back into the kv structure. This is not necessary, as by definition, the state did not change. Additionally, there are no error paths where we depend in this cloning to be able to roll-back the state. 2) Remove copying when normalizing of the `Ingesters` map The costly part here is not normalizing the incoming update, but normalizing the currently held state, as this can be large. By doing this in-place we can avoid a lot of overhead. Both these changes will significantly reduce GC load as both are in essence cloning the ingesters map, only for it to be thrown away shortly after. As a follow up, there might be possibility to avoid the normalization entirely, assuming we can keep the current ring state normalized, but this needs some more reasoning put into it.
- Loading branch information