Guess which runtime decodes a Base64 email attachment fastest: Go, Java, Zig, or Node.js. In Daniel Lemire's benchmark, JavaScript runtimes beat nearly every compiled language—and not even by a close margin.
The twist is line breaks. MIME Base64 in emails inserts \r\n every 76 characters (PEM certificates use 64). Fast decoders rely on SIMD—vector CPU instructions that process dozens of bytes at once. Many expect a flat string, however, and drop into a slow byte-by-byte loop at the first newline.
Single-core tests on a 1.37 MB MIME Base64 payload showed a 30x spread. All top six spots used the C++ simdutf library: C++ (18.4 GB/s), a patched PHP 8.7-dev (17.1 GB/s), Python with fastpybase64 (16.4 GB/s), Bun 1.4.4 (14.2 GB/s), Node.js 26.13 (13.3 GB/s), and Deno 2.9.8 (8.4 GB/s). Trailing behind were .NET 11 (4.9), Go 1.27.4 (1.6), Java 27 (1.2), Zig 0.17.1 (0.85), and PHP 8.5.12 (0.61 GB/s).
simdutf compacts blocks containing line breaks right inside its vector loop. PHP proves the point: on clean Base64, 8.5.12 runs over 20 GB/s, then plunges on MIME—until the simdutf patch speeds it up 28x. In Node.js, Bun, and Deno, built-in Buffer.from(s, 'base64') and Uint8Array.fromBase64(s) already run on simdutf, so there is no need to strip \r\n with regexes first.

