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
POST COMMENT

Comments

There are no comments yet.

Authors

03/30/2017

Faster Base64 Encoding and Decoding Using AVX2 Instructions

Web developers use base64 formats to include images, fonts, sounds and o...
05/28/2020

Flushgeist: Cache Leaks from Beyond the Flush

Flushing the cache, using instructions like clflush and wbinvd, is commo...
09/25/2017

Stream VByte: Faster Byte-Oriented Integer Compression

Arrays of integers are often compressed in search engines. Though there ...
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...
11/07/2019

Efficient Computation of Positional Population Counts Using SIMD Instructions

In several fields such as statistics, machine learning, and bioinformati...
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...
07/17/2017

Speeding up the Köhler's method of contrast thresholding

Köhler's method is a useful multi-thresholding technique based on bounda...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.