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
$300 Free Credits for Your Google Cloud Projects Icon
$300 Free Credits for Your Google Cloud Projects

Start building on Google Cloud with $300 in free credits. No commitment, no credit card required until you're ready to scale.

Launch your next project with $300 in free Google Cloud credits—no strings attached. Test, build, and deploy without risk. Use your credits across the entire Google Cloud platform to find what works best for your needs. After your credits are used, continue with always-free tier services. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
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