Commit ec40ae1
committed
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.1 parent bd9af71 commit ec40ae1
2 files changed
+38
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
1187 | | - | |
| 1187 | + | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
306 | 342 | | |
307 | 343 | | |
308 | 344 | | |
| |||
0 commit comments