Commit daaca16
Ignacio Van Droogenbroeck
perf(encode): skip OmitEmpty slice allocation when no fields omitted
Two-pass approach: first counts surviving fields, returns fs.List
directly if all survive (zero allocs). Only allocates the filtered
slice when fields are actually omitted. Common case for time-series
data where most fields have values.1 parent 82f46cf commit daaca16
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
163 | 173 | | |
| 174 | + | |
| 175 | + | |
164 | 176 | | |
165 | 177 | | |
166 | 178 | | |
| |||
0 commit comments