Pidoku
2Data in Memory

Archive

This learning material is in the archive. It is not currently maintained and has not been updated with the latest information, so tool versions, prices and dates may be out of date.

Data in Memory

Module 26 lessons~5h

Lessons, in order

About this module

Module 1 said slices, strings, maps and interfaces are “small headers that point elsewhere”. This module draws each header, byte by byte, and shows what follows from the drawing.

#LessonThe question it answers
2.aArrays and SlicesWhat is a slice, and when do two slices share memory?
2.bStrings, Bytes and RunesWhat is a string made of, and what does converting it cost?
2.cMapsHow does a map find a key, and what does it cost in memory?
2.dPointers and Struct LayoutHow are fields arranged, and why does field order change a struct’s size?
2.eInterfaces Under the HoodWhat is inside an interface value, and when is nil not nil?
2.fGenerics and IteratorsHow do type parameters work, and what do they cost?

When you finish you can draw any Go value as boxes and arrows, say how many bytes it occupies, and predict whether an operation copies, shares or allocates.

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in