~/talk

Dissecting Slices, Maps and Channels in Go

Talkat Conf42 Golang 2022 · 2022-03-29..03-30· [go, software-architecture]
slides:none on file

Uses an unsafe scalpel and a microscope function to print runtime memory structures and reproducible code. Shows slices growing from capacity 1 to 8 on appends, how a super-slice window shares memory until a resize causes a disconnect, and that append can overwrite the original backing array. Dumps map internals: buckets of eight slots, B increment on resize, overflow buckets created instead of immediate resize, and gradual migration that doubles buckets. Inspects buffered channels (size 4), send/receive indices, parked goroutines on full/empty buffers, and close semantics.

AI-written summary · about

  1. 0:00Introduction
  2. 1:13Slices in memory
  3. 8:58Slice resize surprises
  4. 10:01Go maps structure
  5. 16:44Map resizing and overflow
  6. 20:01Channels memory and buffering
  7. 26:47Closing channels and waiting
  8. 27:51Practical takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.