Simple performance comparison of cache libraries written in golang.
Reports
-
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.
Default parameters
-
256 shards * 32 items, 10s expiration
-
gcache
is 256 shards as default -
set
value
askey+1
whenint
cases
Misc
- create a issue to add new libraries