What a Size Class Is, and Why 16 and 24 Bytes Are Common
What the Go team's post says a size class is, why some small sizes are the most common and what a Go programmer needs to do.
For: Learners curious about memory allocation.
Why some sizes are common
These allocations are some of the most common because they consist of two or three 64-bit values, so they include allocations for things such as interface values and strings which have two values, or slices which have three.[1]
What you need to do
While we hope this explanation of size-specialized allocation is interesting, you as a Go programmer don’t need to think about any of this when writing your code.[1]
Sources
- Size-Specialized Memory Allocation (go.dev · checked )
More articles
- LearningWhy Memory Size Is the Wrong Question for an AI GPUWhat NVIDIA's post says about high bandwidth memory, why useful work per byte is the better question and what it means for bytes to be resident but not working.
- LearningWhy a Mixture-of-Experts Model Needs So Much MemoryWhy the Hugging Face post says mixture-of-experts models have a costly memory caveat, how few experts run per token and what pruning does.
- LearningWhat SIMD Stands For and Why Go Needed Assembly BeforeWhat the Go team's post says SIMD stands for, how its instructions operate on wide registers and what Go programmers had to do before.