Skip to main content
This is lesson 14 of 15 in this module 14/15

Structs versus Classes

We compare structs and classes across value semantics, heap layout, and garbage collector behavior, showing how replacing a list of point classes with a list of point structs reduces heap objects count from one million to one and cuts memory usage from 32 MB to 8 MB for the same data.

Video lesson

Want to watch this lesson?

This lesson is part of the study plan. Get instant access to all lectures, labs and practice exams.

Get the Study Plan