C++ implementation - Show & Tell (sametuca)
Author: sametucaCreated Mar 16, 2026Updated Mar 16, 2026
C++ Implementation - 1BRC (Show & Tell)
Hi! I've implemented a high-performance C++ solution for the 1 Billion Row Challenge. I know the official challenge is Java-only, but I'd like to share it here as mentioned in the FAQ (Show and tell area for non-Java implementations).
Repository: https://github.com/HappyCerberus/1brc (PR #4 - sametuca)
Optimizations applied:
- Memory-mapped I/O with OS-level sequential prefetch hints
- Custom open-addressing hash map with inline key storage
- wyhash, SSE2 SIMD newline scanner, branchless temperature parse
- Thread affinity, prefetch, cache-line alignment, direct output
Compile: g++ -O3 -march=native -std=c++17 -o sametuca src/sametuca.cpp -lpthread
Happy to discuss or share benchmarks if of interest.
Source: gunnarmorling/1brc