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
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
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