Popularity
2.6
Growing
Activity
0.0
Declining
40
4
4
Programming language: Go
License: MIT License
Tags:
Data Structures
2q alternatives and similar packages
Based on the "Data Structures" category.
Alternatively, view 2q alternatives based on common mentions on social networks and blogs.
-
golang-set
A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp. -
hyperloglog
HyperLogLog with lots of sugar (Sparse, LogLog-Beta bias correction and TailCut space reduction) brought to you by Axiom -
ttlcache
DISCONTINUED. An in-memory cache with item expiration and generics [Moved to: https://github.com/jellydator/ttlcache] -
Bloomfilter
DISCONTINUED. Face-meltingly fast, thread-safe, marshalable, unionable, probability- and optimal-size-calculating Bloom filter in go -
hilbert
DISCONTINUED. Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves. -
cuckoo-filter
Cuckoo Filter go implement, better than Bloom Filter, configurable and space optimized 布谷鸟过滤器的Go实现,优于布隆过滤器,可以定制化过滤器参数,并进行了空间优化 -
go-rquad
:pushpin: State of the art point location and neighbour finding algorithms for region quadtrees, in Go -
hide
A Go type to prevent internal numeric IDs from being exposed to clients using HashIDs and JSON.
InfluxDB - Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
Promo
www.influxdata.com
Do you think we are missing an alternative of 2q or a related project?
README
2q
Thread safe GoLang 2Q cache.
Example
import (
"fmt"
twoqueue "github.com/floatdrop/2q"
)
func main() {
cache := twoqueue.New[string, int](256)
cache.Set("Hello", 5)
if e := cache.Get("Hello"); e != nil {
fmt.Println(*e)
// Output: 5
}
}
TTL
See LRU TTL example.
Benchmarks
floatdrop/twoqueue:
Benchmark2Q_Rand-8 4384994 264.5 ns/op 46 B/op 3 allocs/op
Benchmark2Q_Freq-8 4862632 243.9 ns/op 44 B/op 3 allocs/op
hashicorp/golang-lru:
Benchmark2Q_Rand-8 2847627 411.9 ns/op 135 B/op 5 allocs/op
Benchmark2Q_Freq-8 3323764 354.2 ns/op 122 B/op 5 allocs/op