Ignoring differences in the default stack size/memory, why are goroutines any better than pthreads? Goroutines still result in high amounts of context switches. If I’m running a fasthttp server that does nothing but respond with a
200 status code, I’m seeing
~250,000 ctxsw/s (measured with vmstat) when I reach
~200,000 requests per second (8 cores, GOMAXPROCS=8). I see people talk about goroutine context switches being less expensive, but I haven’t seen any data on that - has that been proven to be true?
tl;dr - Memory aside (RAM is cheap), are goroutines better than concurrency models in other languages that map onto pthreads? Why?