https://golang.org/doc/go1.4#runtime
- Interface always store pointer into the value part, never store literal type value even if it's size can fit into a pointer size.
- stacks are no longer segmented, When a stack limit is reached, a new, larger stack is allocated, all active frames for the goroutine are copied there, and any pointers into the stack are updated.
Allocate each Go routine a contiguous piece of memory for its stack, grown by reallocation/copy when it fills up.
Design doc:
https://docs.google.com/document/d/1wAaf1rYoM4S4gtnPh0zOlGzWtrZFQ5suE8qr2sD8uWQ/pub - The use of contiguous stacks means that stacks can start smaller without triggering performance issues, so the default starting size for a goroutine's stack in 1.4 has been reduced from 8192 bytes to 2048 bytes.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.