All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Fix concurrency issues in
ratelimiter: TOCTOU race condition betweenTryAcceptandUpdateRateLimit(use single lock to protect check-and-create) - Fix infinite loop in
connpool.ClearPool: removed dead loop waiting foractiveNum == 0and ineffectivep = nilassignment - Fix busy-wait sleep in
workpool.mustGetWorker: replacedtime.Sleep(sleepInterval)with blocking channel wait
- Optimize cache
Len()from O(n) to O(1): avoid creating temporary map by directly using internal data structure size - Optimize cache
HasKey()from O(n) to O(1): use direct map lookup instead ofKeys()+ linear search - Optimize cache
Keys()andGetALL(): reduce from N lock acquisitions to single lock acquisition - Fix
GetBetweenStrunnecessary byte-to-string conversions - Fix
SliceShuffleto use Fisher-Yates algorithm for uniform randomness - Fix
SliceRandListweak seed: useUnixNano()instead ofNanosecond() - Fix
connpool.Pop()idle cleanup: collect connections to disconnect first, then release lock before disconnecting
- Add race detector to unittest workflow (
go test -race) - Add dependency caching to CI workflows for faster builds
- Update dependabot schedule from daily to weekly with better grouping (k8s, otel, prometheus libs)
- Update issue templates with version and Go version fields
- Remove unused
utilsimports from cache plugins (lru, lfu, fifo, simple) - Add
ArcList.Keys()method to support proper key iteration in ARC plugin - Fix unsafe type assertions in
utils.ToStringDict,utils.InterfacesToStrings,utils.ToStrings,utils.ToMapStrings,utils.Strings: replace direct type assertions with ok-check pattern to prevent panic - Add safety documentation to
utils.String2Bytesandutils.Bytes2String: clarify that returned slices share memory with original data and must not be modified
v1.0.2 - 2023-01-05
- [Feat] Add simple cache & arc cache mode
v1.0.1 - 2023-01-05
- [Feat] Add stream reader & writer package
- [Feat] Add Bitmap reader & writer package
v1.0.0 - 2022-11-22
- 支持
lru、lfu和随机淘汰算法,同时也支持时间过期淘汰; - 支持
event回调: load加载回调、加载成功回调、对象淘汰回调; - 支持全局内存最大值设置(全局内存) 或 全局最大block(对象数)对象设置;
- 支持 metircs 统计 key 的命中率情况分析;
- 支持 Cache 内部数据 匹配查询(hash), 也支持近似值匹配查询(多阶二分查找);
- 支持 内存无GC 高性能模式;
- 支持
json、ini和 环境变量 配置 - 支持 默认值 设置与限制
- 支持 内存使用 配置
cli输出
- 支持
连接对象 Connect Obeject、全局公用对象 Global Obeject、数据对象 Data Objetc管理 - 支持 对象
保活、最小可用、最小空闲管理 - 支持
event回调: connect前、clear前、销毁前 回调; - 支持单机百万TPS管理
- 支持etcd注册、healthcheck、configure下载、心跳保活
- 支持 多个 errors 压栈传递
- 支持 errors 全局统一管理 和 标准序列号
- 支持 自定义Error 管理
- 完全兼容golang标准库日志模块,拥有六种日志级别
- 支持扩展的Hook机制
- 支持日志输出格式:JSONFormatter和TextFormatter
- 支持日志轮转:按log大小 和 按日期
- 支持日志清理:按log总大小 和 按日期
- 支持最高性能
- 支持
prometheus数据接口 - 支持
opentelemetry数据接口 - 支持 atomic 内存态 统计
- 支持
RingQueue、PriorityQueue内存队列管理 - 支持无锁高性能队列使用
- 支持 令牌桶、滑动时间窗口 限流模式
- 支持对对象限流: 可用于全局 和 部分sub对象限流 的 生成、处理 和 销毁
- 支持超过一定大小、将临时缓冲转成临时文件
- 支持异步写源信息:io.Reader转换成io.ReadSeeker
- 支持异步读取源信息后关闭
- 支持 任务
保活、最小可用、最小空闲管理 - 支持
event回调: 执行前、执行完成后、销毁前回调; - 支持
goroutine链方式管理;整个栈内存支持全局设置 - 支持 异常处理
failover处理
- 支持
Map、Strings、Time等基础数据转换 - 支持
version版本号比较 - 支持
数据diff
- Unittest、staticcheck、lint errors