Go good reads
Index
Performance
If you want to know how high performance systems written in Go were built, read VictoriaLogs: https://github.com/VictoriaMetrics/VictoriaLogs by Phuong Le
- Custom bloom filters to reduce disk I/O and CPU cycles for redundant logs.
- Column-oriented block storage for better compression ratio and cache locality.
- Memory-mapped files with automatic pread fallback for zero-copy reads.
- Lock-free object pools and arena allocators to reduce heap allocations.
- Reflection-free JSON parsers for streaming at hundreds of MB/s per core.
- Compile-time templates replace text/html parsing with near-printf speed.
- Dictionary-aware Zstd compression balancing CPU cost against bandwidth savings.
- Multi-core parallelism everywhere with adaptive concurrency limits.
- Scatter-gather fan-out writes with adaptive concurrency for network saturation.
- Fast hashing and lock-free randomization for minimal contention.
How Go 1.24's Swiss Tables saved us hundreds of gigabytes by Nayef Ghattas
Finding performance problems by diffing two Go profiles by Zach Musgrave
Optimising and Visualising Go Tests Parallelism: Why more cores don't speed up your Go tests
Leveraging benchstat Projections in Go Benchmark Analysis!
Benchmarks and performance testing
New unique package by Michael Knyszek
This work also led us to reexamine finalizers, resulting in another proposal for an easier-to-use and more efficient replacement for finalizers. With a hash function for comparable values on the way as well, the future of building memory-efficient caches in Go is bright!
It is wonderful to see that the Go team is working on improving the memory management of Go.
Inline Heuristics Review
On Thursday 3/28 we held a design review looking at the new inlining heuristics framework being developed as part of the inlining overhaul effort (this was a separate session from the usual C&R meeting)
From Go compiler and runtime meeting notes
Go 1.22 inlining overhaul
pprof documentation
A Deep Look Into Golang Profile-Guided Optimization (PGO)
Profiling and Execution Tracing in Go
- What I learned
- pprof can diff with
go tool pprof -http=:8080 -diff_base <file2> <file1>
- pprof can diff with
How to Write Accurate Benchmarks in Go
- Not resetting or pausing the timer
- Making wrong assumptions about micro-benchmarks
- Not being careful about compiler optimizations
- Being fooled by the observer effect
Obscure Go Optimisations - Bryan Boreham
- Take-aways
- Slice-to-interface cast will allocate.
- Heap allocation is costly.
- Generic methods are not fast.
- Heap Ballast is dead.
- Long live GOMEMLIMIT!
Fixing Memory Exhaustion Bugs in My Golang Web App
Go 메모리 관련 OOM 버그를 수정하는 여정에 관한 이야기
디버깅 과정을 상세하게 공유해 주고 있으며, 특히 Other lessons learned 와 Dead ends 파트에서 공유해준 내용에는 배울 점이 많습니다.
Bounds Check Elimination in Go 101
PGO
- Profile Guided optimisation by Andrew Phillips
- cmd/compile: PGO opportunities umbrella issue in github.com/golang/go Issuues
Concurrency
Go synctest: Solving Flaky Tests by Phuong Le
Generics
Deconstructing Type Parameters by The Go Blog
Reiaibility
NilAway: Practical Nil Panic Detection for Go by the Uber engineering blog
HTTP
Which Go router should I use? by Alex Edwards
Organize your Go middleware without dependencies by Alex Edwards
Others
What's //go:nosplit for? by Miguel Young de la Sota
JSON evolution in Go: from v1 to v2 by Anton Zhiyanov
We Replaced Our React Frontend with Go and WebAssembly by Alex Suraci
Common Go Mistakes
Go compiler and runtime meeting notes
go HACKING.md
Go basically never frees heap memory back to the operating system
Go 1.20 Experiment: Memory Arenas vs Traditional Memory Management
Despite the tradeoffs, arena is a very cool feature.
DRAFT RELEASE NOTES — Introduction to Go 1.20
- Interesting for me
- Profile-guided optimization(PGO)
- Wrapping multiple errors
- Other links
GopherCon 2021: Suzy Mueller - Debugging Treasure Hunt
- Log point is great.
- We can make a breakpoint with the function name.