企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
[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)) ```