Golang | cmd - go build 构建模式

build modes The ‘go build’ and ‘go install’ commands take a -buildmode argument which indicates which kind of object file is to be built. Currently supported values are: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 -buildmode=archive Build the listed

Golang | cmd - go build 构建约束

Build Constraints(约束) Build -tags A build constraint, also known as a build tag, is a line comment that begins 1 // +build that lists the conditions under which a file should be included in the package. Constraints may appear in any kind of source file (not just Go), but they must appear near the top of

Golang | Performance Optimization => 优化建议

转自:Debugging performance issues in Go programs 1. 将多个小对象合并成一个大对象 2. 减少不必要的指针简介引用,多使用 copy 引用 例如使用 bytes.Buffer 代替 *bytes.Buffer, 因为使用指针时会分配

Golang | Stdlib - runtime

了解 runtime 包中的的环境变量 了解 runtime 包中的基本函数及使用 目录 1. 概述 2. 环境变量 2.1. GOGC 2.2. GODEBUG 2.3. GOMAXPROCS 2.4. GOTRACEBACK 2.5. GOARCH、GOOS、GOPATH、GOROOT 3. 基

Golang | Performance Optimization => pprof

go tool pprof 用法 cpu、goroutine、heap 分析方法 pprof Pprof 是一款可视化的性能分析工具,源自 Google Performance Tools 工具集。用于确定程序运行过程中CPU和内存的

Golang | 程序性能优化学习笔记

程序优化有哪些方式和步骤? 可供选择的调优工具有哪些? 调优之前 如何做Go的性能优化? 调优方式 要监控程序性能,有下面几种方式: Timers: 计时器,用于基准