A Golang lock-free thread-safe HashMap optimized for fastest read access. It is not a general-use HashMap and currently has slow write performance for write-heavy use. The minimal supported Golang version is 1.19 as it makes use of Generics and the new atomic package helpers. Reading from the hash map for numeric key types in a thread-safe way is faster than reading from a standard Golang map in an unsafe way and four times faster than Golang's sync.Map. Technical design decisions have been made based on benchmarks that are stored in an external repository: go-benchmark. The library uses a sorted linked list and a slice as an index into that list. The Get() function contains helper functions that have been inlined manually until the Golang compiler will inline them automatically. It optimizes the slice access by circumventing the Golang size check when reading from the slice.

Features

  • A Golang lock-free thread-safe HashMap optimized for fastest read access
  • It is not a general-use HashMap and currently has slow write performance for write heavy uses
  • The minimal supported Golang version is 1.19 as it makes use of Generics and the new atomic package helpers
  • Use the map to count URL requests
  • The library uses a sorted linked list and a slice as an index into that list
  • For hashing, specialized xxhash implementations are used that match the size of the key type where available

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

Apache License V2.0

Follow hashmap

hashmap Web Site

Other Useful Business Software
AI-generated apps that pass security review Icon
AI-generated apps that pass security review

Stop waiting on engineering. Build production-ready internal tools with AI—on your company data, in your cloud.

Retool lets you generate dashboards, admin panels, and workflows directly on your data. Type something like “Build me a revenue dashboard on my Stripe data” and get a working app with security, permissions, and compliance built in from day one. Whether on our cloud or self-hosted, create the internal software your team needs without compromising enterprise standards or control.
Try Retool free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of hashmap!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-02-01