Skip to content

SaintWish/kv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kv

GoDoc

A collection of a few Go packages for Key Value storage like caches.

go get github.com/saintwish/kv

Packages

All of the packages of generic support for safety. Some of the packages use the swiss map instead of the default Go map.

  • kv1 - A Key Value sharded cache with time expiration. Uses swiss map.

  • kv1s - A Key Value sharded cache without any auto eviction. Uses swiss map.

  • kv2 - A Key Value sharded cache with a max size and automated eviction when the map gets full. I wouldn't use it because that eviction method is flawed. Uses swiss map.

  • kvswiss - A Key Value cache that is non-sharded using the swiss map as it's backend.

  • kvmap - A Key Value sharded cache using vanilla Go map with no auto eviction.

  • ccmap - A concurrent safe default Go map without sharding.

  • stack - A last in, first out stack implementation without concurrency support. Used in the kv2 package.

Benchmarks

You can run benchmarks in the "main" using go test -bench . -benchmem. There's some packages missing from the benchmarks however because they should be the same as kv1 one basically except for different eviction methods.

Licensing

The swiss map and this package are licensed with Apache-2.0