▲ | pron 8 months ago | |||||||
1. How significant that portion is may be lower than you think. 2. Stack allocation adds complexity that actually can adversely affect performance. The main problem is that for stack objects to behave more like heap objects, you need to be able to reference them. References into the stack make user-mode threads less flexible. For example, Go takes a significant hit for Go-native interop in goroutines, whereas Java doesn't pay that cost. 3. Why do you, as a user, care if the GC is more complex? | ||||||||
▲ | masklinn 8 months ago | parent [-] | |||||||
> How significant that portion is may be lower than you think. And it’s probably higher than you think. > References into the stack make user-mode threads less flexible. For example, Go takes a significant hit for Go-native interop in goroutines, whereas Java doesn't pay that cost. This has nothing to do with on-stack structure, it has to do with Go not using C-compatible stacks. If this was an actual issue C would take a hit when calling C. > Why do you, as a user, care if the GC is more complex? GC complexity impacts its cost and performances. Generational GCs have more overhead than non-generational ones. That cost needs to be reclaimed by avoiding full collections or the generational GC is a net loss. And that is what the go team observed on many workloads when they experimented with making Go’s GC generational. | ||||||||
|