Commit b714b72
⚡ Add slice pre-allocation optimizations
Optimize slice allocations in boxcutter to reduce memory overhead:
1. Pre-allocate trimmedPrevious with ClusterExtensionRevisionPreviousLimit capacity
- Avoids reallocation as the slice grows
2. Smart pre-allocation in splitManifestDocuments
- Estimates document count based on line count
- Reduces allocations when processing large helm manifests
- Minimum capacity of 4 for small bundles
These micro-optimizations reduce GC pressure during revision processing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent f6bcbbb commit b714b72
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
| 339 | + | |
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| |||
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
380 | | - | |
381 | | - | |
382 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
383 | 391 | | |
384 | 392 | | |
385 | 393 | | |
| |||
0 commit comments