Notes on Go & systems

Go, explained the way it actually works.

I’m Phuong Le, a software engineer at VictoriaMetrics building VictoriaLogs. I’m also the author of The Anatomy of Go, where we discuss Go in depth.

This is where I try to explain things as clearly as I possibly can: Go, backend engineering, and the systems underneath.

01

How Go's Built-in Map Works with Swiss Tables

If you’re interested in how Go’s built-in map works, I wrote a full article about it for the VictoriaMetrics blog: How Go’s Built-in Map …

1 min read GoMaps
How Go's Built-in Map Works with Swiss Tables
02

Understanding Go's sync.Map from API to hash trie

If you’re interested in how sync.Map works, I wrote a full article about it for the VictoriaMetrics blog: Understanding Go’s sync.Map from …

1 min read GoConcurrency
Understanding Go's sync.Map from API to hash trie
03

sync.Pool in Go explained & avoid the heap allocation mistake

The discussion in this video isn’t only about the basics of sync.Pool, but also about how it works at a higher level. How to avoid heap …

1 min read GoConcurrency
sync.Pool in Go explained & avoid the heap allocation mistake
04

Data races and the memory model in Go

We write a value in one goroutine and read it in another. Nothing crashes, and the value is there. It looks like our code works. We actually got …

16 min read GoConcurrency
Data races and the memory model in Go
05

How Go detects struct copies with sync.noCopy

If you have read the source code of the sync package, you may have noticed that several structs contain an unusual field of type noCopy, such as …

11 min read GoConcurrency
How Go detects struct copies with sync.noCopy
06

Go runtime metrics: CPU, GC, memory, scheduler

Go exposes many runtime metrics through runtime/metrics, and many metrics clients (Prometheus, VictoriaMetrics) use it to export Go runtime stats from …

17 min read GoRuntime
Go runtime metrics: CPU, GC, memory, scheduler
07

SIGHUP signal for configuration reloads

Many applications, including Go applications by default, respond to three signals for termination: SIGTERM, SIGINT, and SIGHUP. Among these, SIGHUP …

8 min read GoBackend
SIGHUP signal for configuration reloads
08

Select and for range on Go channels

In Go channels from first principles, we went through one channel at a time: send, receive, close, and what buffered, nil, and closed channels do. Our …

9 min read GoConcurrency
Select and for range on Go channels
09

Go channels from first principles

In Goroutines 101: A basic walkthrough, we went through goroutines, how they run on OS threads, and what GOMAXPROCS does. Those examples did not show …

11 min read GoConcurrency
Go channels from first principles
10

Goroutines 101: A basic walkthrough

Go makes concurrency much easier than most other languages. In Java, you decide between platform threads, virtual threads, and the thread pools of …

9 min read GoConcurrency
Goroutines 101: A basic walkthrough