2 ms·
"my understanding is it keeps a stack of statements to execute a function end." The official Go compiler a couple of versions back optimized this away to the o
by jerf 6y ago
"my understanding is it keeps a stack of statements to execute a function end."
The official Go compiler a couple of versions back optimized this away to the obvious (if you know about compilers) mapping of region to what defers need to be run on exit and can compile them in now. If your function uses it like a stack, it'll use a stack like it used to, but it optimizes the common case of a handful of defers in the main body now.