Topics / Bit packing and smaller types

Performance topic

Bit packing and smaller types

Fit more data in each cache line and register: narrower integers, half precision, packed structs and bitfields.

1,306proven techniques
55pitfalls: tried, then slower
641repositories
207from papers

Examples from real commits

rubinius/rubinius 8× Count UTF-8 continuation bytes a word at a time with a SWAR mask and multiply, skipping whole machine words of characters at once. proof: commit → NVIDIA/cudf 2× Pack multistate segments into 32-bit bitfields and use shifts instead of array access proof: commit →

Languages

  • C++487
  • C182
  • Rust144
  • CUDA79
  • Python58
  • Go25

Hardware

  • CPU294
  • GPU201
  • NVIDIA GPU200
  • x86157
  • ARM51

Fields

  • graphics323
  • data & compression261
  • general244
  • GPU194
  • compilers116

Where these come from

Repositories with the most techniques on this topic in the database:

PlummersSoftwareLLC/Primes · 11a16z/jolt · 8turanszkij/WickedEngine · 8syv-ai/HyperQwen · 8openvinotoolkit/openvino · 7google/angle · 70xShug0/audio.cpp · 6servo/webrender · 6NVIDIAGameWorks/dxvk-remix · 6DynamoRIO/dynamorio · 6

Ask Claude for the full answer

Each technique comes with its bottleneck, measured speedup, trade-offs, conditions and the commit or paper behind it, served to Claude through MCP.

claude mcp add --transport http adtomic https://www.adtomic.co/mcp

Connect Claude Pricing

Related topics

Lazy evaluationZero-copyBranchless programmingInlining and devirtualizationLookup tables