Commit 2b13b81
Remove redundant PAD check in base64 decode fast path
Address review feedback from serhiy-storchaka: the fast path was doing
two checks per group - an explicit PAD comparison and the invalid char
check in base64_decode_quad().
Change PAD's table entry from 0 to 64 so the existing (v0|v1|v2|v3)&0xc0
check catches it, eliminating 4 comparisons per group.
The slow path is unaffected since it checks for PAD character before
the table lookup.
Decode is ~16% faster at 64K (1.62 GB/s → 1.88 GB/s).
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent f7b27ee commit 2b13b81
2 files changed
+3
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 180 | + | |
193 | 181 | | |
194 | 182 | | |
195 | 183 | | |
| |||
0 commit comments