Commit 13bf46b
CNDB-16175: CNDB-15990: Avoid varargs allocations in atomicMoveWithFallback (#2124)
riptano/cndb#15990
- What: Eliminates unnecessary array allocations in
PathUtils.atomicMoveWithFallback() by pre-allocating CopyOption[] arrays
as static constants.
- Why: JFR profiling showed this method was a memory allocation hotspot
during RemoteFileCache preloading. Each call to Files.move() with
varargs parameters created new arrays, causing excessive GC pressure.1 parent 4d371dd commit 13bf46b
1 file changed
+25
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | 102 | | |
104 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
105 | 127 | | |
106 | 128 | | |
107 | 129 | | |
| |||
556 | 578 | | |
557 | 579 | | |
558 | 580 | | |
559 | | - | |
| 581 | + | |
560 | 582 | | |
561 | 583 | | |
562 | 584 | | |
563 | 585 | | |
564 | | - | |
| 586 | + | |
565 | 587 | | |
566 | 588 | | |
567 | 589 | | |
| |||
0 commit comments