netpoll
netpoll copied to clipboard
WIP: perf: replace mcache with pcache
trafficstars
What type of PR is this?
perf
What this PR does / why we need it (en: English/zh: Chinese):
en: replace mcache with pcache zh: 使用 pcache 替代 mcache
Which issue(s) this PR fixes:
- 经过测试 make([]byte, int) 与 mmap 创建一块堆外内存,在 pcache 中影响不大。
- P.active 通过无锁队列实现 100% 均衡,产生的性能开销要比收益大很多,所以去除了这段逻辑。
- 收益最大的来源还是固定从当前 P 中获取内存
风险点:GC 速度取决于 gc trigger 的速度,是否有 OOM 的风险?建议先从内存占比不大的服务开始试点。