Commit b53d324
perf(l64a): encode into the static buffer, drop the per-call heap allocation — 5.1x -> 1.07x
l64a delegated to `core::stdlib::l64a`, which returns a freshly heap-allocated
`Vec<u8>` (Vec::with_capacity(6)) every call, then copied it into the static
return buffer — a malloc+free per call for a trivial ≤6-char base-64 encode.
glibc uses a static buffer with no allocation, so fl was ~5.1x slower.
Inlined the encode (the SVID base-64 alphabet + the low-32-bits divide loop)
directly into the static BUF, byte-identical to the old core->Vec->copy path but
allocation-free. 5.10x -> 1.07x vs glibc (residual is the membrane decision).
Isomorphism verified: fl l64a matches host glibc l64a for 200013 values (0,
boundaries 63/64/0xFFFFFFFF, negatives, i32::MIN/MAX, and random) — 0
divergences. Existing a64l_l64a_differential_fuzz and stdlib-numeric tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0655fbd commit b53d324
1 file changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3144 | 3144 | | |
3145 | 3145 | | |
3146 | 3146 | | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
3147 | 3152 | | |
3148 | | - | |
3149 | | - | |
3150 | | - | |
3151 | | - | |
3152 | | - | |
3153 | | - | |
3154 | | - | |
3155 | | - | |
3156 | | - | |
3157 | 3153 | | |
3158 | 3154 | | |
3159 | 3155 | | |
3160 | | - | |
3161 | | - | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
3162 | 3171 | | |
3163 | 3172 | | |
3164 | 3173 | | |
| |||
0 commit comments