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

You Might Also Like
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start 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