当前位置:网站首页>四、高性能 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
边栏推荐
- Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.10 tabbar component (I) how to open and use the default tabbar comp
- 2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
- 抽丝剥茧C语言(高阶)指针的进阶
- RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
- Music | cat and mouse -- classic not only plot
- 组件的通信
- Libcurl returns curlcode description
- 【mysqld】Can't create/write to file
- Blue Bridge Cup Netizen age (violence)
- Composition API premise
猜你喜欢

Release notes of JMeter version 5.5

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

freeswitch拨打分机号源代码跟踪

Calculus key and difficult points record part integral + trigonometric function integral

Reflection (II)

Pass parent component to child component: props

非父子组件的通信

How does an enterprise manage data? Share the experience summary of four aspects of data governance

深度学习花书+机器学习西瓜书电子版我找到了

抽丝剥茧C语言(高阶)指针的进阶
随机推荐
Config distributed configuration center
詳解機器翻譯任務中的BLEU
Example of Pushlet using handle of Pushlet
Fullgc problem analysis and solution summary
95后CV工程师晒出工资单,狠补了这个,真香...
选择商品属性弹框从底部弹出动画效果
考研失败,卷不进大厂,感觉没戏了
Advanced level of C language (high level) pointer
Mobx knowledge point collection case (quick start)
Tool class: object to map hump to underline underline hump
抽丝剥茧C语言(高阶)指针的进阶
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
弹性布局(一)
MySQL binlog related commands
1089: highest order of factorial
详解机器翻译任务中的BLEU
抽絲剝繭C語言(高階)指針的進階
弹性布局(二)
"Xiaodeng in operation and maintenance" meets the compliance requirements of gdpr
组件的嵌套和拆分