当前位置:网站首页>四、高性能 Go 语言发行版优化与落地实践 青训营笔记
四、高性能 Go 语言发行版优化与落地实践 青训营笔记
2022-07-07 03:40:00 【低调的骏马】
高性能 Go 语言发行版优化与落地实践 | 青训营笔记
这是我参与「第三届青训营 -后端场」笔记创作活动的的第4篇笔记
内存方面
一、自动内存管理
概念:
Mutator:业务线程,分配新对象,修改对象指向关系(创建的goroutine)
Collector:GC线程,找到存活对象,回收死亡对象的内存空间
Serial GC:只有一个collector
Parallel GC:支持多个collectors同时回收的GC算法
Concurrent GC:mutator(s)和collector(s)可以同时执行
GC:
GC算法:安全性、吞吐率、暂停时间、内存开销
追踪垃圾回收:
- 标记根对象
- 标记可达对象
- 清理不可达对象
- 根据对象的生命周期使用不同的标记和清理策略
分代GC:
年龄:经历过GC的次数
目的:针对不同年龄年轻或者老年的对象,制定不同的GC策略,降低整体内存管理的开销
引用计数:
- 每个对象有与之关联的引用次数,大于0则是存活
- 缺点是无法回收环形数据结构、维护引用计数开销较大
二、Go内存管理及优化
内存分配:
分块
缓存
管理优化
go的内存分配
- 实际优化方案:Balanced GC
编译器优化
一、编译器和静态分析
编译器结构:
静态分析:
过程内分析、过程间分析:
二、Go编译器优化
函数内联:
逃逸分析:
静态分析:
过程内分析、过程间分析:
二、Go编译器优化
函数内联:
逃逸分析:
Beast mode
边栏推荐
- 组件的通信
- 【mysqld】Can't create/write to file
- 深度学习花书+机器学习西瓜书电子版我找到了
- $refs:组件中获取元素对象或者子组件实例:
- Pass parent component to child component: props
- . Net core accesses uncommon static file types (MIME types)
- freeswitch拨打分机号源代码跟踪
- How does an enterprise manage data? Share the experience summary of four aspects of data governance
- Lvs+kept (DR mode) learning notes
- 子组件传递给父组件
猜你喜欢
main函数在import语句中的特殊行为
抽丝剥茧C语言(高阶)指针的进阶
Circulating tumor cells - here comes abnova's solution
MySQL service is missing from computer service
Fast quantitative, abbkine protein quantitative kit BCA method is coming!
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.9 introduction to network interface (IX) extending the request3 met
Model application of time series analysis - stock price prediction
Flexible layout (II)
URP - shaders and materials - simple lit
Freeswitch dials extension number source code tracking
随机推荐
How Oracle backs up indexes
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
Abnova membrane protein lipoprotein technology and category display
$refs:组件中获取元素对象或者子组件实例:
Stack Title: nesting depth of valid parentheses
Release notes of JMeter version 5.5
Docker compose start redis cluster
Summary of customer value model (RFM) technology for data analysis
Tool class: object to map hump to underline underline hump
Modify the jupyter notebook file path
机器人技术创新与实践旧版本大纲
Bindingexception exception (error reporting) processing
PostgreSQL source code (59) analysis of transaction ID allocation and overflow judgment methods
修改Jupyter Notebook文件路径
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
Abnova immunohistochemical service solution
【mysqld】Can't create/write to file
js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
readonly 只读
Complete process of MySQL SQL