Web developers use base64 formats to include images, fonts, sounds and other resources directly inside HTML, JavaScript, JSON and XML files. We estimate that billions of base64 messages are decoded every day. We are motivated to improve the efficiency of base64 encoding and decoding. Compared to state-of-the-art implementations, we multiply the speeds of both the encoding (~10x) and the decoding (~7x). We achieve these good results by using the single-instruction-multiple-data (SIMD) instructions available on recent Intel processors (AVX2). Our accelerated software abides by the specification and reports errors when encountering characters outside of the base64 set. It is available online as free software under a liberal license.
翻译:Web开发者使用Base64格式将图片、字体、音频等资源直接嵌入HTML、JavaScript、JSON和XML文件中。据估算,每天有数十亿条Base64消息被解码。我们致力于提升Base64编码与解码的效率。相比现有最优实现,我们将编码速度提升约10倍,解码速度提升约7倍。这些优异成果得益于采用英特尔最新处理器(AVX2)提供的单指令多数据流(SIMD)指令。我们优化的软件严格遵循规范,并在遇到Base64字符集之外的字符时报告错误。该软件以自由许可证形式作为免费软件在线发布。