~/talk

Memory Optimization through Structure Packaging

Talkat GopherCon Europe 2024 · 2024-06-17..06-20· [go, web-performance]
links:none on file
slides:none on file

Shows concrete results from Go: reordering fields cuts struct size from 128 vs 72 bytes, moves objects into smaller mspan classes (examples: 128, 80, 144 bytes), and yields a benchmarked speedup of ~43% runtime on the demo that creates and iterates slices of those structs. Explains allocator size classes, that a 1‑byte change can force a jump to a larger mspan and drastically drop density (fewer objects per page), and reports real‑world memory wins of about 5–40% in an observability library.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03Struct padding basics
  3. 2:52Alignment rules
  4. 5:02Reordering struct fields
  5. 6:06Benchmarking memory layout
  6. 7:50Key takeaways
  7. 8:32Mspan size classes
  8. 10:19Struct size impact
  9. 11:51Small optimizations matter
  10. 12:53Trade-offs of reordering
~/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.