Commit aee724f
committed
perf(decoder): @inline(__always) on decodeFixedWidthInteger helpers
A direct BEFORE/AFTER benchmark on Apple M2 Pro caught the generic
helpers added in c4531f3 introducing a +5% mean regression on numeric-
heavy decode paths (e.g. `Decode 100K rows (numeric fields)` +6.4%,
`Decode 100K rows (simple)` +5.2%). The compiler wasn't fully
specialising the `<T: FixedWidthInteger>` generic across all nine call
sites without the hint.
Adding `@inline(__always)` to both helpers collapses the regression to
within run-to-run noise (≤+2% on remaining cases, several scenarios
actually faster than the pre-refactor baseline):
Decode 100K rows (simple) 153.05 → 154.51 ms +0.95%
Decode 100K rows (numeric) 157.27 → 159.82 ms +1.62%
Decode 100K transactions 501.64 → 498.26 ms -0.67%
Decode 100K log entries 490.61 → 489.19 ms -0.29%
Encode 100K rows 129.09 → 125.28 ms -2.95%
Encode 10K rows (quoted) 11.92 → 11.71 ms -1.76%
Encode 100K rows to String 127.37 → 124.69 ms -2.10%
Mixed: Decode+Transform+Encode 29.15 → 28.73 ms -1.43%
305/305 tests pass.1 parent 58a8e12 commit aee724f
2 files changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
489 | 494 | | |
490 | 495 | | |
491 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
0 commit comments