All Projects → telekons → 42nd-at-threadmill

telekons / 42nd-at-threadmill

Licence: BSD-2-Clause license
A SIMD-accelerated concurrent hash table.

Programming Languages

common lisp
692 projects

Projects that are alternatives of or similar to 42nd-at-threadmill

ADbHash
Really fast C++ hash table
Stars: ✭ 12 (-75.51%)
Mutual labels:  simd, hashtable
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (+12.24%)
Mutual labels:  hashtable, concurrent-data-structure
ternary-logic
Support for ternary logic in SSE, XOP, AVX2 and x86 programs
Stars: ✭ 21 (-57.14%)
Mutual labels:  simd
sliceslice-rs
A fast implementation of single-pattern substring search using SIMD acceleration.
Stars: ✭ 66 (+34.69%)
Mutual labels:  simd
multiversion
Easy function multiversioning for Rust
Stars: ✭ 152 (+210.2%)
Mutual labels:  simd
hermes
A Haskell library for fast, memory-efficient decoding of JSON documents using the simdjson C++ library
Stars: ✭ 37 (-24.49%)
Mutual labels:  simd
uwu
fastest text uwuifier in the west
Stars: ✭ 1,193 (+2334.69%)
Mutual labels:  simd
Boost.simd
Boost SIMD
Stars: ✭ 238 (+385.71%)
Mutual labels:  simd
ctl
My variant of the C Template Library
Stars: ✭ 105 (+114.29%)
Mutual labels:  hashtable
patchmap
A fast and memory efficient hashmap using sorting to resolve collisions
Stars: ✭ 41 (-16.33%)
Mutual labels:  hashtable
go-left-right
A faster RWLock primitive in Go, 2-3 times faster than RWMutex. A Go implementation of concurrency control algorithm in paper <Left-Right - A Concurrency Control Technique with Wait-Free Population Oblivious Reads>
Stars: ✭ 42 (-14.29%)
Mutual labels:  concurrent-data-structure
aes-gcm-siv
.NET Core 3.0 implementation of AES-GCM-SIV nonce misuse-resistant authenticated encryption
Stars: ✭ 22 (-55.1%)
Mutual labels:  simd
quick-adc
Quick ADC
Stars: ✭ 20 (-59.18%)
Mutual labels:  simd
memchr
Optimized string search routines for Rust.
Stars: ✭ 474 (+867.35%)
Mutual labels:  simd
lsp-dsp-lib
DSP library for signal processing
Stars: ✭ 37 (-24.49%)
Mutual labels:  simd
processor
A compiler, assembler, and processor.
Stars: ✭ 24 (-51.02%)
Mutual labels:  simd
Mipp
MIPP is a portable wrapper for SIMD instructions written in C++11. It supports NEON, SSE, AVX and AVX-512.
Stars: ✭ 253 (+416.33%)
Mutual labels:  simd
simd-byte-lookup
SIMDized check which bytes are in a set
Stars: ✭ 23 (-53.06%)
Mutual labels:  simd
Turbo-Transpose
Transpose: SIMD Integer+Floating Point Compression Filter
Stars: ✭ 50 (+2.04%)
Mutual labels:  simd
SCNMathExtensions
Math extensions for SCNVector3, SCNQuaternion, SCNMatrix4
Stars: ✭ 32 (-34.69%)
Mutual labels:  simd

A fast concurrent hash table.

42nd At Threadmill is a nearly lock-free* hash table based on Cliff Click's NonBlockingHashMap, and Abseil's flat_hash_map. We use the general layout of the former, and the fast metadata-based probing trick of the latter.

We are aware of the table being very, very picky with hash functions (Abseil's table is like that too, but I don't think it's that bad), so you might want to hold off using this table in production still.

See A Fast Wait-Free Hash Table and Matt Kulukundis's "Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step" presentation for an introduction to both tables.

We use SSE2 intrinsics for fast probing, and optionally use AVX2 for faster byte broadcasting. This library requires a post-2.0.5 version of SBCL, so that we can use some instructions introduced to the assembler around then.

*Okay, we effectively lock to resize but it won't deadlock and it appears to be faster than using Click's lock-free resizing technique; so you tell me if that is an acceptable trade-off.

Pictures of a benchmark

Differences from Click's table

We replace copied values with a single +copied+ marker instead of an instance of a Prime class. This change generates less garbage when copying, and leads to slightly faster barrier code; though our table is not wait-free. (Truth be told, we're only barely getting a grip on Click's resize logic now.)

We also removed the <key, tombstone> state, having removes transition back to <key, empty>; a superficial change which doesn't appear to affect anything.

Differences from Kulukundis's table

As Click requires us to pin keys to entries, we don't ever use tombstone metadata. The metadata for a dead entry remains in the metadata table, as we need to be able to find the right key entry to reuse quickly.

We have a somewhat improved load factor, but it is not as extreme as Kulukundis's demonstration. Kulukundis could approach a load factor of 87.5%, but we find that 50% is the best tradeoff between space and throughput with our table. However, we still have improved over Click's table -- Click doubles the table size with 25% live keys, and quadruples with 50% live, in order to "avoid endless reprobing". Faster probing lets us get away with just doubling at 50%.

Previous work

This concurrent hash table is based off the NonBlockingHashMap, and its Common Lisp port in Luckless. It is also based off the linear probing hash table implementation in SICL, as well as its SIMD fork.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].