Base64 encoding and decoding at almost the speed of a memory copy

10/02/2019
by   Wojciech Muła, et al.
0

Many common document formats on the Internet are text-only such as email (MIME) and the Web (HTML, JavaScript, JSON and XML). To include images or executable code in these documents, we first encode them as text using base64. Standard base64 encoding uses 64 ASCII characters: both lower and upper case Latin letters, digits and two other symbols. We show how we can encode and decode base64 data at nearly the speed of a memory copy (memcpy) on recent Intel processors, as long as the data does not fit in the first-level (L1) cache. We use the SIMD (Single Instruction Multiple Data) instruction set AVX-512 available on commodity processors. Our implementation generates several times fewer instructions than previous SIMD-accelerated base64 codecs. It is also more versatile, as it can be adapted—even at runtime—to any base64 variant by only changing constants.

READ FULL TEXT
research
03/30/2017

Faster Base64 Encoding and Decoding Using AVX2 Instructions

Web developers use base64 formats to include images, fonts, sounds and o...
research
12/09/2022

Transcoding Unicode Characters with AVX-512 Instructions

Intel includes on its recent processors a powerful set of instructions c...
research
09/25/2017

Stream VByte: Faster Byte-Oriented Integer Compression

Arrays of integers are often compressed in search engines. Though there ...
research
02/24/2017

An analysis of core- and chip-level architectural features in four generations of Intel server processors

This paper presents a survey of architectural features among four genera...
research
11/26/2019

System Performance with varying L1 Instruction and Data Cache Sizes: An Empirical Analysis

In this project, we investigate the fluctuations in performance caused b...
research
11/07/2019

Efficient Computation of Positional Population Counts Using SIMD Instructions

In several fields such as statistics, machine learning, and bioinformati...
research
11/08/2019

nanoBench: A Low-Overhead Tool for Running Microbenchmarks on x86 Systems

We present nanoBench, a tool for evaluating small microbenchmarks using ...

Please sign up or login with your details

Forgot password? Click here to reset