# Faster Population Counts Using AVX2 Instructions

arXiv: https://arxiv.org/abs/1611.07612 · HTML: https://mlsanity.com/paper/1611.07612/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 23 Nov 2016.

## Built on by (most cited first, 1 of 1)

- [Phonetic Word Embeddings](https://mlsanity.com/paper/2109.14796/) (2021)

## Abstract (arXiv)

Counting the number of ones in a binary stream is a common operation in database, information-retrieval, cryptographic and machine-learning applications. Most processors have dedicated instructions to count the number of ones in a word (e.g., popcnt on x64 processors). Maybe surprisingly, we show that a vectorized approach using SIMD instructions can be twice as fast as using the dedicated instructions on recent Intel processors. The benefits can be even greater for applications such as similarity measures (e.g., the Jaccard index) that require additional Boolean operations. Our approach has been adopted by LLVM: it is used by its popular C compiler (clang).
