当前位置:网站首页>四、高性能 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
边栏推荐
- 子组件传递给父组件
- Model application of time series analysis - stock price prediction
- RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
- Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park
- mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
- Bus message bus
- 选择商品属性弹框从底部弹出动画效果
- Release notes of JMeter version 5.5
- 抽絲剝繭C語言(高階)數據的儲存+練習
- Outlier detection technology of time series data
猜你喜欢
Composition API 前提
Lm11 reconstruction of K-line and construction of timing trading strategy
Bus message bus
外包干了四年,废了...
Flexible layout (I)
弹性布局(二)
Abnova circulating tumor DNA whole blood isolation, genomic DNA extraction and analysis
Unity3d learning notes
main函数在import语句中的特殊行为
Project practice five fitting straight lines to obtain the center line
随机推荐
云备份项目
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
Differences between H5 architecture and native architecture
Reflection (II)
. Net core accesses uncommon static file types (MIME types)
【mysqld】Can't create/write to file
Paranoid unqualified company
Pass parent component to child component: props
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
readonly 只读
组件的通信
Precise space-time travel flow regulation system - ultra-high precision positioning system based on UWB
Software acceptance test
freeswitch拨打分机号源代码跟踪
Causes and solutions of oom (memory overflow)
Blue Bridge Cup Birthday candles (violence)
Blue Bridge Cup Netizen age (violence)
Sqlmap tutorial (IV) practical skills three: bypass the firewall
How does an enterprise manage data? Share the experience summary of four aspects of data governance
toRefs API 与 toRef Api