title = "Escape! From the Allocations: Escape Analysis in Pypy, LuaJIT, V8, C++, Go and More!" date = 2020-07-04
+++
With software engineering, speed and memory are the basic measurement-benchmarkes. For programming language implementations, the two affect each other heavily. In JIT compilers, that means storing more things in memory to speed up the program drastically. It also means putting time into garbage collection to keep memory down, spending time to try to eliminate allocations and deciding where to put some piece of data.
Escape Analysis is a technique that determines the behaviour of how a variable (more specifically, a pointer) is used in a certain scope, and whether it not it escapes that scope (the scope is usually a function). Escape analysis allows the program to stack allocate (here is an article on Stack vs Heap allocations) when it's determined the variable will not be used outside of the scope