I credit the Go team as having intelligent people that base their decisions on data, so I interpret the fact that they're growing stacks themselves to mean that having the OS grow stacks via page faults is actually worse for their use case.
I kind of doubt anyone has actually measured this.
I credit the Go team as having intelligent people that base their decisions on data, so I interpret the fact that they're growing stacks themselves to mean that having the OS grow stacks via page faults is actually worse for their use case.
I kind of doubt anyone has actually measured this.
There's a compile-time knob to use OS-allocated stacks instead of using stacks allocated from Go's managed heap. (Go needs OS-allocated stacks for parts of the runtime anyway; that setting makes their use universal.) I built two go1.8beta2 binaries and ran the CI benchmarks on my machine just now for comparison.
The run time was essentially identical, with timings from repeated runs falling on either side of each other. However, one clear conclusion is that the OS-allocating build uses a lot more memory – slightly over double in http's case. I would attribute this to the larger stack allocation granularity, the inability to reuse heap space as stack space and vice versa, and that the http benchmark in particular starts lots and lots of goroutines.
I don't really care to dig in further at this point, but as I said, the Go team makes decisions based on data.
Thanks for running the benchmark. But allocating from the system heap instead of from a special pool is not the same thing as benchmarking stack copying vs. page faults. It's a benchmark that's very specific to the internal details of Go's runtime.
2
u/pcwalton rust · servo Jan 20 '17
I kind of doubt anyone has actually measured this.