tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.49k stars 913 forks source link

Improve GC stack scanning #4550

Open aykevl opened 3 weeks ago

aykevl commented 3 weeks ago

Right now, the GC will scan only the in-use part of the stack of the current goroutine, but for every other goroutine it will scan the entire stack (not just the part that contains any data).

This can be fixed for the precise GC in the following way:

If there are multiple goroutines in a running program, I think this will significantly improve GC performance.