当前位置:网站首页>四、高性能 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
边栏推荐
- SQLMAP使用教程(四)实战技巧三之绕过防火墙
- Unity C function notes
- LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
- URP - shaders and materials - simple lit
- 非父子组件的通信
- Flexible layout (I)
- [Luogu p1971] rabbit and egg game (bipartite game)
- Answer to the second stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition
- Reflection (II)
- 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
猜你喜欢

抽丝剥茧C语言(高阶)数据的储存+练习

Answer to the second stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition

Composition API 前提
![How to model and simulate the target robot [mathematical / control significance]](/img/bd/79f6338751b6773859435c54430ec3.png)
How to model and simulate the target robot [mathematical / control significance]

RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving

mips uclibc 交叉编译ffmpeg,支持 G711A 编解码

URP - shaders and materials - simple lit

Implementing data dictionary with JSP custom tag

Lvs+kept (DR mode) learning notes

About binary cannot express decimals accurately
随机推荐
URP - shaders and materials - simple lit
PostgreSQL source code (60) transaction system summary
异步组件和Suspense(真实开发中)
toRefs API 与 toRef Api
详解机器翻译任务中的BLEU
The currently released SKU (sales specification) information contains words that are suspected to have nothing to do with baby
Sqlmap tutorial (IV) practical skills three: bypass the firewall
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
Complete process of MySQL SQL
C language (high-level) data storage + Practice
AVL树的实现
Mobx knowledge point collection case (quick start)
Procedure in PostgreSQL supports transaction syntax (instance & Analysis)
Pass child component to parent component
抽丝剥茧C语言(高阶)指针进阶练习
Causes and solutions of oom (memory overflow)
Composition API 前提
Advanced level of C language (high level) pointer
Basic process of network transmission using tcp/ip four layer model
Abnova circulating tumor DNA whole blood isolation, genomic DNA extraction and analysis