🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] > [github](https://github.com/allegro/bigcache) ## 概述 - 如果你本地依然有千万级的 keys,那推荐你用 bigcache。 - 超大 map 的内存池导致的 GC 延迟,是可以通过切 bigcache 解决的 - shards map + map[uint]uint + []byte + free link = BigCache ## 实例 ``` import "github.com/allegro/bigcache" cache, _ := bigcache.NewBigCache(bigcache.DefaultConfig(10 * time.Minute)) cache.Set("my-unique-key", []byte("value")) entry, _ := cache.Get("my-unique-key") fmt.Println(string(entry)) ```