gitwtfhub

wtf is radsort?

klauspost/radsort — explained in plain English

Analysis updated 2026-05-18

25GoAudience · developerComplexity · 2/5Setup · easy

TL;DR

A Go library for fast, memory-efficient radix sorting of integers, floats, and custom types, with a parallel mode for very large slices.

Mindmap

mindmap
  root((radsort))
    What it does
      Radix sort in Go
      Low memory use
      Stable sort
    Tech stack
      Go
    Use cases
      Sort large slices
      Sort key value pairs
      Parallel sorting
    Audience
      Go developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Sort large slices of integers or floats quickly while using very little extra memory.

REASON 2

Speed up sorting key-value pairs, such as struct records, using a custom key function.

REASON 3

Sort very large arrays in parallel across multiple CPU cores without a big memory cost.

REASON 4

Iterate over a map's entries or a slice's values in sorted order without fully re-sorting them.

What's in the stack?

Go

How it stacks up

klauspost/radsortadisbladis/nix-cache-beaconaspecttaleadapter/adobe-lightroom-classic-15-3-full
Stars252525
LanguageGoGoGo
Setup difficultyeasyhardeasy
Complexity2/54/51/5
Audiencedeveloperops devopsgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Wtf does this do

Radsort is a Go library that implements a fast sorting algorithm called LSD radix sort, based on a 2026 research paper by Robert Clausecker and Florian Schintke. It is a Go port of the paper authors' original C code. The main selling point is memory efficiency: most radix sort implementations need a second array as big as the input to work with, but radsort gets by with only a small, fixed amount of extra memory, roughly the square root of the input size. It achieves this by treating the input as a sequence of fixed size blocks and reusing each block as output space right after it has been read, instead of allocating a whole separate buffer. A small tracking array keeps note of where each block currently lives, so the actual data barely needs to be moved until a final step puts everything back in the caller's original slice. The sort keeps equal elements in their original relative order, a property called stability. The library provides ready to use functions for common Go types such as unsigned and signed integers of different sizes, plus floating point numbers, and a generic function for sorting any custom type by a key you provide. It also offers ways to reuse memory buffers across repeated calls so nothing new is allocated after the first run, to iterate over a slice or map in sorted order without fully rewriting it, and a parallel version that spreads the work across multiple CPU cores while keeping the same low memory use. The README backs its claims with detailed benchmark tables comparing radsort against Go's standard library sort across different input sizes and data patterns, showing large speed advantages on random data of moderate to large size, though the standard sort wins on very small inputs and on data that is already sorted or nearly sorted, since it can detect and skip that work.

Yoink these prompts

Prompt 1
How do I use radsort to sort a slice of uint32 values in Go?
Prompt 2
Explain how radsort keeps memory usage low compared to a typical radix sort.
Prompt 3
Show me how to reuse a Sorter to sort repeated batches without extra allocations.
Prompt 4
When should I use radsort instead of Go's standard library sort?

Frequently asked questions

wtf is radsort?

A Go library for fast, memory-efficient radix sorting of integers, floats, and custom types, with a parallel mode for very large slices.

What language is radsort written in?

Mainly Go. The stack also includes Go.

How hard is radsort to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is radsort for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.