Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: perf: replace mcache with pcache #204

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

WIP: perf: replace mcache with pcache #204

wants to merge 4 commits into from

Conversation

joway
Copy link
Member

@joway joway commented Oct 24, 2022

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:

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has totally checked 83 files.

Valid Invalid Ignored Fixed
53 2 28 0
Click to see the invalid file list
  • pcache.go
  • pcache_test.go

pcache.go Show resolved Hide resolved
pcache_test.go Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@joway
Copy link
Member Author

joway commented Oct 25, 2022

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

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

@joway joway changed the title perf: replace mcache with pcache WIP: perf: replace mcache with pcache Oct 31, 2022
@joway joway changed the title WIP: perf: replace mcache with pcache WIP: perf: replace mcache with pcache Oct 31, 2022
@CLAassistant
Copy link

CLAassistant commented Nov 22, 2022

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants