# Efficient Random Sampling -- Parallel, Vectorized, Cache-Efficient, and Online

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

## Key facts

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

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

- [Stable and Semi-stable Sampling Approaches for Continuously Used Samples](https://mlsanity.com/paper/2203.01381/) (2022)

## Abstract (arXiv)

We consider the problem of sampling n numbers from the range 1,ldots,N without replacement on modern architectures. The main result is a simple divide-and-conquer scheme that makes sequential algorithms more cache efficient and leads to a parallel algorithm running in expected time O(n/p+log p) on p processors, i.e., scales to massively parallel machines even for moderate values of n. The amount of communication between the processors is very small (at most O(log p)) and independent of the sample size. We also discuss modifications needed for load balancing, online sampling, sampling with replacement, Bernoulli sampling, and vectorization on SIMD units or GPUs.
