Simple performance comparison of cache libraries written in golang.
-
kpango/gache & hlts2/gocache not performs well, so remove them out from the benchmark list.
-
patrickmn/go-cache is FIFO mode, FishGoddess/cachego and patrickmn/go-cache are based on simple map with expiration (without hit rate case), and others are LRU mode.
bigcache | cachego | ecache | freecache | gcache | gocache | |
PutInt | π | π | ||||
GetInt | π | |||||
Put1K | π | π | π | |||
Put1M | π | π | π | |||
PutTinyObject | π | π | ||||
ChangeOutAllInt | π | π | ||||
HeavyReadInt | π | π | π | π | ||
HeavyReadIntGC | π | π | ||||
HeavyWriteInt | π | π | π | |||
HeavyWriteIntGC | π | |||||
HeavyWrite1K | π | π | π | |||
HeavyWrite1KGC | π | π | π | |||
HeavyMixedInt | π | π | π |
π for very-slow,
βοΈ for fast, π for very-fast.
-
256 shards * 32 items, 10s expiration
-
gcache
is 256 shards as default -
set
value
askey+1
whenint
cases
- create a issue to add new libraries