Simple performance comparison of cache libraries written in golang.
Reports
Continuous Bencmark Result (click here)
Default parameters
-
256 shards * 32 items, 10s expiration
-
gcache
is 256 shards as default
哈喽,orca zhang,我是 cachego 的开发者 fish goddess,感谢您在性能测试中加入了 cachego 的对比!
我对这个性能测试项目挺感兴趣的,同时也注意到 cachego 在多项测试中性能不占优势,尤其是 heavy 的 GC 表现 这个问题我之前有留意过,但是没有去关注,在 v0.3.x 版本中我引入了一些新功能,并简单优化了一下,目前的 GC 表现要比 v0.2.x 版本好一些,您也可以关注下。
这是在我的电脑上跑出来的结果:
goos: windows
goarch: amd64
v0.2.5
pkg: github.com/benchplus/gocache/cachego
BenchmarkHeavyWriteInt_cachego-16 1 18663533100 ns/op
BenchmarkHeavyWrite1K_cachego-16 1 24625462000 ns/op
BenchmarkHeavyWrite1KGC_cachego-2 1 618853400 ns/op
BenchmarkHeavyReadIntGC_cachego-2 1 9887800 ns/op
BenchmarkHeavyWriteIntGC_cachego-2 1 458641100 ns/op
v0.3.1-alpha
pkg: github.com/benchplus/gocache/cachego
BenchmarkHeavyWriteInt_cachego-16 1 5289654900 ns/op
BenchmarkHeavyWrite1K_cachego-16 1 7652751900 ns/op
BenchmarkHeavyWrite1KGC_cachego-2 1 263519600 ns/op
BenchmarkHeavyReadIntGC_cachego-2 1 6112900 ns/op
BenchmarkHeavyWriteIntGC_cachego-2 1 186907000 ns/op
PS:这边还有一个 https://github.com/patrickmn/go-cache
的缓存库使用者也挺多的,是否可以加上 : )
最后,希望这个测试可以越做越好!
Gin-cache - Gin cache middleware with golang
A high performance gin middleware to cache http response. Compared to gin-contrib/cache. It has a huge performance improvement.
cache Package cache is a middleware that provides the cache management for Flamego. Installation The minimum requirement of Go is 1.16. go get github.
memcache a mem cache base on other populator cache, add following feacture add lazy load(using expired data, and load it asynchronous) add singlefligh
Cache A simple cache implementation LRU Cache An in memory cache implementation
GoCache Simple in-memory key-value cache with default or specific expiration time. Install go get github.com/DylanMrr/GoCache Features Key-value stor
BigCache Fast, concurrent, evicting in-memory cache written to keep big number of entries without impact on performance. BigCache keeps entries on hea
go-generics-cache go-generics-cache is an in-memory key:value store/cache that is suitable for applications running on a single machine. This in-memor
GCache Cache library for golang. It supports expirable Cache, LFU, LRU and ARC. Features Supports expirable Cache, LFU, LRU and ARC. Goroutine safe. S
gdcache is a pure non-intrusive distributed cache library implemented by golang, you can use it to implement your own distributed cache
Dumbcache Cache list, count with filter param golang, using struct, hashkey Structure we hash your request object to md5 hashing and add a prefix coun
go-cache Light weight thread safe LRU cache Getting started import( "fmt" "github.com/tak1827/go-cache/lru" ) func main() { size := 2 cache := l
A File Cache With Golang
gocodecache An in-memory cache library for code master in Golang. Installation g
Go语言QQ群: 102319854, 1055927514 凹语言(凹读音“Wa”)(The Wa Programming Language): https://github.com/wa-lang/wa LRU Cache Install go get github.com/chai2010/c
groupcache Summary groupcache is a distributed caching and cache-filling library, intended as a replacement for a pool of memcached nodes in many case
Gocache Guess what is Gocache? a Go cache library. This is an extendable cache library that brings you a lot of features for caching data. Overview He
A high performance memory-bound Go cache
Fast thread-safe inmemory cache for big number of entries in Go. Minimizes GC overhead