This repository was archived by the owner on Nov 7, 2022. It is now read-only.
Commit afdb3a1
Steven Karis
nodebatcher: Allow batcher pre-allocations to reduce on new batch (#419)
* Allow batcher pre-allocations to reduce on new batch
Currently, we re-use the previous capacity size when pre-allocating
space for the new batch in nodebatcher. This doesn't work well when a
node has had high throughput and then stops sending traffic, or maybe
the process that was sending a lot of traffic shifts to another node.
This PR reduces allocation space based not just on current cap, but also
current size to fix this.
* Move comment placement
* Refactor marginally
* PR comments1 parent 9b5a4ab commit afdb3a1
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
240 | 247 | | |
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
244 | 251 | | |
245 | 252 | | |
246 | | - | |
| 253 | + | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
| |||
0 commit comments