gitwtfhub

wtf is hashmap?

tidwall/hashmap — explained in plain English

Analysis updated 2026-08-08 · repo last pushed 2026-02-24

228GoAudience · developerComplexity · 2/5MaintainedSetup · easy

TL;DR

A fast Go key-value store and Set type that replaces the standard library map for high-throughput workloads using advanced hashing and memory-efficient design.

Mindmap

mindmap
  root((repo))
    What it does
      Key-value Map type
      Set type for membership
      Faster than standard map
    Tech stack
      Go generics
      xxh3 hashing algorithm
      Robin Hood hashing
    Use cases
      High-throughput services
      Fast key lookups
      Tracking item membership
    Audience
      Go developers
      Performance-focused devs
    Limitations
      Unordered keys only
      Needs manual benchmarking
      No sorted order support

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

Build a high-throughput service that reads and writes keyed data faster than the standard map allows.

REASON 2

Track membership of items in a Set without storing duplicate values.

REASON 3

Store and look up key-value pairs with any Go data type including strings, numbers, and custom structs.

What's in the stack?

GoGo genericsxxh3

How it stacks up

tidwall/hashmapnetflix/titus-executorolemeyer/rocketplaneio
Stars228230225
LanguageGoGoGo
Last pushed2026-02-242023-01-10
MaintenanceMaintainedDormant
Setup difficultyeasyhardmoderate
Complexity2/54/54/5
Audiencedeveloperops devopsops devops

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

How do you spin it up?

Difficulty · easy Time to first run · 5min

Just run go get to add the package, no external infrastructure or configuration needed.

No license information is mentioned in the explanation.

Wtf does this do

This project gives Go programmers a faster, smarter way to store and look up data by key. Think of it as a high-performance replacement for Go's built-in map, the thing you use when you want to say "give me the value associated with this key" and get it back quickly. It offers two main types: a Map for key-value pairs (like storing a phone number for each name) and a Set for just tracking whether things exist (like a VIP list). Under the hood, it uses a few well-known techniques to squeeze out extra speed. "Open addressing" and "Robin Hood hashing" are strategies for placing items in memory so that lookups require fewer steps. The xxh3 algorithm is a fast method for turning keys into numeric addresses. The package also automatically reclaims memory when items are deleted, so the data structure doesn't quietly hold onto space it no longer needs. It supports Go generics, meaning it works with any data type, strings, numbers, custom structs, without extra plumbing. The target audience is Go developers who need a bit more performance than the standard library map provides, or who want a standalone Set type. Someone building a high-throughput service that constantly reads and writes keyed data might choose this for the speed gains shown in the project's benchmarks. The main tradeoff is that this only handles unordered data, if you need keys to stay in sorted or insertion order, the author points to a separate btree package instead. The README doesn't go into much detail on when the performance difference matters in practice, so developers would need to benchmark against the standard map for their own use cases.

Yoink these prompts

Prompt 1
Write a Go program using tidwall/hashmap that creates a Map with string keys and int values, adds 1000 entries, and looks up a specific key. Compare the lookup speed to a standard Go map.
Prompt 2
Create a Go service endpoint using tidwall/hashmap Set to track unique visitor IDs from incoming requests and check if a visitor has been seen before.
Prompt 3
Using tidwall/hashmap with Go generics, build a cache layer that stores custom struct values keyed by string, including delete operations that automatically reclaim memory.
Prompt 4
Benchmark tidwall/hashmap Map against Go's built-in map for 10000 insertions and 10000 lookups. Show me the results and explain when the performance difference matters.

Frequently asked questions

wtf is hashmap?

A fast Go key-value store and Set type that replaces the standard library map for high-throughput workloads using advanced hashing and memory-efficient design.

What language is hashmap written in?

Mainly Go. The stack also includes Go, Go generics, xxh3.

Is hashmap actively maintained?

Maintained — commit in last 6 months (last push 2026-02-24).

What license does hashmap use?

No license information is mentioned in the explanation.

How hard is hashmap to set up?

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

Who is hashmap for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

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