4 ms·
You can't bump-allocate 6K contiguous to an existing 2K allocation, and Go currently requires the stack to be contiguous.
by shereadsthenews 8y ago
You can't bump-allocate 6K contiguous to an existing 2K allocation, and Go currently requires the stack to be contiguous.
- pcwalton 8y agoThat's right, but you can bump-allocate a new 6K and copy over. It's a lot faster than falling through to a general-purpose malloc implementation.
- shereadsthenews 8y agoThat’s not obviously true. Page sized and page aligned allocation is pretty fast in Go. Having a generational GC where all pointers are movable could have systemic impact in the performance of the whole program.
- pcwalton 8y agoIf it were fast enough, then caching stacks wouldn't be a win. Bump allocation is like 6 instructions. The idea that generational GC would not be a win does not match the experience of any other language. Generational GC is virtually always a win for languages like Go. This is just another reason why Go should adopt it.
- shereadsthenews 8y agoIt's possible. Go has been replaying the entire history of GC research at about 2.5x forward speed. They should intercept the state of the art eventually.
- readittwice 8y agoIsn't it a win because the goroutine now starts with 4K of stack instead of 2K? This makes the stack large enough, such that the stack doesn't have to expanded on every request.