Goroutine vs. OS Thread: 70x Faster Context Switching

Goroutine context switches average around 54 nanoseconds, a stark contrast to the 3-5 microseconds required for a typical Linux OS thread switch, making them approximately 70 times faster. This significant difference stems from OS threads necessitating expensive kernel mode transitions and saving a much larger CPU state, including numerous registers.

Sources

Open the full topic