netpoll icon indicating copy to clipboard operation
netpoll copied to clipboard

WIP: perf: replace mcache with pcache

Open joway opened this issue 3 years ago • 2 comments
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:

joway avatar Oct 24 '22 06:10 joway

  • 经过测试 make([]byte, int) 与 mmap 创建一块堆外内存,在 pcache 中影响不大。
  • P.active 通过无锁队列实现 100% 均衡,产生的性能开销要比收益大很多,所以去除了这段逻辑。
  • 收益最大的来源还是固定从当前 P 中获取内存

风险点:GC 速度取决于 gc trigger 的速度,是否有 OOM 的风险?建议先从内存占比不大的服务开始试点。

joway avatar Oct 25 '22 06:10 joway

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 22 '22 06:11 CLAassistant