HackerPapers

arXiv:1704.00605cs.MS

Faster Base64 Encoding and Decoding Using AVX2 Instructions

Wojciech Muła, Daniel Lemire

Abstract

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.

arXiv comments
software at https://github.com/lemire/fastbase64
Journal reference
ACM Transactions on the Web 12 (3), 2018
DOI
doi:10.1145/3132709
Subjects
cs.MSMathematical Software cs.PFPerformance

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 2 threads, from Jan 2018 to Nov 2019.

Comments linking this paper, per year.

Discussed in comments2 threads

    • The authors have been doing good work in this area for a while: https://arxiv.org/abs/1704.00605

      taspeotisView on HNParent context

    • > Why is that an achievement? There are tables in the paper comparing its speed to other implementations. This is more than an order of magnitude faster than the implementation used in Chrome, and for small data more than twice as fast as their previous AVX2 based implementation…

      boomlindeView on HNParent context

    • https://arxiv.org/abs/1704.00605 In short, they spend roughly (EDIT: Herp-derp) 1/5th a cycle per byte of base64 through the use of AVX2 instructions to encode / decode base64. So one-cycle every 5 bytes. This includes robust error checking (allegedly) --------- Because…

      dragontamerView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.