Commit d19fe68
committed
perf(lint): end File's pointer block on a slice, not a bare pointer
Round-2 code review's efficiency angle re-ran fieldalignment after
this PR's File reorder settled and found a residual, smaller finding
beyond the original 688->640 size fix: "struct with 488 pointer
bytes could be 472". RunCache *RunCache sat last among the
pointer-bearing fields; a bare pointer's entire width is its GC
pointer word, so ending the block there left no free non-pointer
tail. Reordering so linkRefs []Reference is the last pointer-bearing
field instead lets its 16-byte len/cap tail fall outside ptrdata for
free, since a slice only GC-scans its 8-byte data-pointer word.
Ref: docs/development/high-performance-go.md#struct-layout1 parent e3560a2 commit d19fe68
1 file changed
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 152 | | |
162 | 153 | | |
163 | 154 | | |
| |||
175 | 166 | | |
176 | 167 | | |
177 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
178 | 186 | | |
179 | 187 | | |
180 | 188 | | |
| |||
0 commit comments