Commit fae1aa7
Improve
* Add benchmark for `*PartitionWriter.WriteProfileSymbols`
I had to perform the initialization within the for loop as otherwise
it always panics.
* Refactor `*PartitionWriter.WriteProfileSymbols` for DRY
Thank you @simonswine for the suggestion!
Co-authored-by: Christian Simon <simon@swine.de>
* Create rewriting map with maximum capacity
By doing this we avoid having to regrow the map, which improves CPU
and memory consumption.
* Use temp slice to append only once
Instead of checking `s.slice` on each call to append and regrow if
necessary, create a temporary slice with the maximum possible
capacity, and append that slice to `s.slice` outside the for loop,
effectively checking and regrowing `s.slice` only once.
This further improves CPU and memory consumption.
* Use stdlib slices.Grow to grow the slice
---------
Co-authored-by: Christian Simon <simon@swine.de>*deduplicatingSlice.ingest performance (#4037)1 parent 6cdda61 commit fae1aa7
2 files changed
+23
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
257 | | - | |
| 258 | + | |
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
| |||
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| 283 | + | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
0 commit comments