Skip to content
Search lessons, topics, tests…
Esc

    ↑ ↓ moveEnter openEsc close
    C# Internals and Performance: back to the track

    Guided course · C# Internals and Performance

    C# Memory and the .NET Runtime: Value Types, Boxing, Spans, GC and JIT

    • How C# really runs, the way interviewers ask about it.
    • What a variable holds, where values live, and how big an object is.
    • Boxing, and where it hides in interfaces, generics and collections.
    • ref, out and in, defensive copies, ref safety and ref struct.
    • Span, Memory, stackalloc and ArrayPool for work without garbage.
    • The garbage collector, large objects, GC modes, Dispose and leaks.
    • IL, the JIT, tiered compilation, Native AOT, and measuring memory honestly.
    Intermediate6 modules · 23 lessons · 5 h 36 min · 17 practice tests · 2 free

    Module 1 · Values, References and Objects

    4 lessons · 58 min
    1. 01Value Types vs Reference Types in C#: What a Variable Really HoldsFree, 1 practice test15 min
    2. 02Stack vs Heap in .NET: Where C# Values Really LiveFree15 min
    3. 03Inside a .NET Object: Header, Method Table and Object Size (included with Full Access), 1 practice test14 min
    4. 04Struct or Class in C#: Designing Value Types That Stay Fast and Correct (included with Full Access), 1 practice test14 min

    Module 2 · Boxing

    2 lessons · 31 min
    1. 05Boxing and Unboxing in C#: What the Runtime Does and What It Costs (included with Full Access), 1 practice test15 min
    2. 06Hidden Boxing in C#: Interfaces, Generics, Collections and String Formatting (included with Full Access)16 min

    Module 3 · ref, in, out and Ref Safety

    4 lessons · 59 min
    1. 07ref, out and in Parameters in C#: Passing Variables, Not Values (included with Full Access), 1 practice test15 min
    2. 08in, ref readonly and Defensive Copies: Passing Large Structs in C# (included with Full Access)13 min
    3. 09Ref Locals and Ref Returns in C#: Safe Aliases Into Arrays and Collections (included with Full Access), 1 practice test16 min
    4. 10Ref Safety in C#: Escape Rules, scoped, ref Fields and ref struct (included with Full Access), 1 practice test15 min

    Module 4 · Spans and Buffers

    5 lessons · 1 h 13 min
    1. 11Span<T> and ReadOnlySpan<T> in C#: Slicing Without Copying (included with Full Access), 1 practice test14 min
    2. 12stackalloc and ArrayPool<T> in C#: Temporary Buffers Without Garbage (included with Full Access)14 min
    3. 13Memory<T> and Buffer Ownership in C#: Buffers Across await (included with Full Access), 1 practice test14 min
    4. 14Parsing Text Without Temporary Strings: Spans, string.Create, SearchValues and UTF-8 (included with Full Access), 1 practice test15 min
    5. 15Writing and Framing Bytes: IBufferWriter<T>, System.IO.Pipelines and Binary Formats (included with Full Access), 1 practice test16 min

    Module 5 · The Garbage Collector

    5 lessons · 1 h 12 min
    1. 16How the .NET Garbage Collector Works: Roots, Marking, Compaction and Generations (included with Full Access), 1 practice test14 min
    2. 17Large Objects and Pinning in .NET: the LOH, the POH and Frozen Objects (included with Full Access), 1 practice test14 min
    3. 18GC Modes in .NET: Workstation, Server, Background GC, DATAS and Regions (included with Full Access), 1 practice test13 min
    4. 19Finalizers, IDisposable and SafeHandle: Cleanup the GC Does Not Do (included with Full Access), 1 practice test16 min
    5. 20Memory Leaks in .NET: What Keeps Objects Alive and How to Find It (included with Full Access), 1 practice test15 min

    Module 6 · The JIT and Measuring

    3 lessons · 43 min
    1. 21From C# to Machine Code: IL, the JIT, Tiered Compilation, PGO, ReadyToRun and Native AOT (included with Full Access), 1 practice test14 min
    2. 22What the .NET JIT Optimizes Away: Inlining, Devirtualization and Escape Analysis (included with Full Access)15 min
    3. 23Measuring Memory and Speed in .NET: BenchmarkDotNet, Counters and Honest Numbers (included with Full Access)14 min

    TechInterviewNotes Editorial Team ·