Skip to content

jokruger/densemap

Repository files navigation

densemap

Go Reference Go Report Card codecov

Package densemap provides a generic, dense, ID-based mapping structure for fast, contiguous lookups by integer ID. Unlike Go’s built-in map, densemap stores values in a slice indexed by a bounded integer range [minID, maxID]. This design ensures O(1) access, efficient iteration, and predictable memory usage, making it well-suited for cases where IDs are compact and naturally bounded (e.g., enums, small identifier spaces, event codes).

Install

Run go get github.com/jokruger/densemap

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

DenseMap is a generic, dense, ID-based mapping structure for fast, contiguous lookups by integer ID.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors