Comment by gleenn
10 days ago
> The only "pause" threads experience is the callback executed in response to the soft handshake, which does work bounded by that thread's stack height.
So this is probably not great for functional/deeply-recursive code I guess?
Meh.
The stack scan is really fast. There's not a lot of logic in there. If you max out the stack height limit (megabytes of stack?) then maybe that means milliseconds of work to scan that stack. That's still not bad.
That's a very long time. Milliseconds of work is an entire frame update-render cycle in a modern game.
Would your modern game have a stack that is so deep that it brushes up against the stack height limit?
Probably not. Your game would be inches of stack away from crashing
7 replies →
Games don't tend to have very deep callstacks. And if a game cared about performance also wanted to use GC, it would probably try to run the GC at the end of a frame when there is little on the stack.
2 replies →
Latency-sensitive programs like games are usually careful to avoid deep recursion.