{"repo":"VictoriaMetrics/fastcache","free":true,"listed":false,"github":"https://github.com/VictoriaMetrics/fastcache","clone":"git clone https://github.com/VictoriaMetrics/fastcache.git","description":"Fast thread-safe inmemory cache for big number of entries in Go. Minimizes GC overhead","language":"Go","stars":2370,"topics":["golang","go","cache","inmemory-cache","fast","caching","caching-library"],"license":"MIT","category":"dev-tools","readme_excerpt":"fastcache - fast thread-safe inmemory cache for big number of entries in Go Features Fast. Performance scales on multi-core CPUs. See benchmark results below. Thread-safe. Concurrent goroutines may read and write into a single cache instance. The fastcache is designed for storing big number of entries without GC overhead. Fastcache automatically evicts old entries when reaching the maximum cache size set on its creation. Simple API. Simple source code. Cache may be saved to file and loaded from file. Works on Google AppEngine. Benchmarks Fastcache performance is compared with BigCache, standard Go map and sync.Map. MB/s column here actually means millions of operations per second . As you can see, fastcache is faster than the BigCache in all the cases. fastcache is faster than the standard Go map and sync.Map on workloads with inserts. Limitations Keys and values must be byte slices. Other types must be marshaled before storing them in the cache. Big entries with sizes exceeding 64KB must be stored via distinct API. There is no cache expiration. Entries are evicted from the cache only on cache size overflow. Entry deadline may be stored inside the value in order to implement cache expiration. Architecture details The cache uses ideas from BigCache: The cache consists of many buckets, each with its own lock. This helps scaling the performance on multi-core CPUs, since multiple CPUs may concurrently access distinct buckets. Each bucket consists of a hash(key) - (key, value) pos","default_branch":null,"files":null,"tree":[],"storefront":"/r/VictoriaMetrics","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/VictoriaMetrics/fastcache/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}