What is a performance track

broken image
broken image
broken image

Though there is a performance penalty, it’s as cheap as it’s gonna get.

broken image

This is a very quick process and makes stack allocations basically free. Whenever you make a local variable, it stores it on the stack, and whenever your function exits and the variable goes out of scope, it is automatically cleaned off the stack. It’s the same physical memory as the heap of course, it’s just fast because it’s a very orderly First-In, Last-Out data structure. The Stack is fast, and is used for value types that have a fixed byte size. Both are specific memory locations in the memory assigned to your program, from your computer’s available RAM. To understand what a garbage collector does, you first need to understand the difference between memory stored on the stack, and memory stored on the heap. However, it’s important to understand the performance implications of leaving GC to do your job. While manual memory management like C++ can be quite fast, automatic garbage collection improves the quality-of-life for developers. Garbage collection is a feature of many languages like C# and Java.