aklomp / base64

Fast Base64 stream encoder/decoder in C99, with SIMD acceleration
BSD 2-Clause "Simplified" License
866 stars 162 forks source link

Generic encoders: use 12-bit lookup table #64

Closed aklomp closed 4 years ago

aklomp commented 4 years ago

Switch from a 6-bit lookup table to a 12-bit lookup table in the Generic32 and Generic64 encoders. Some quick tests show that halving the memory accesses greatly increases performance, at the cost of a larger lookup table (4096 bytes). Not a hard tradeoff.

Tables can be generated with a small Python script. Tables differ for little-endian and big-endian architectures.