Advanced
Go (Golang)
Q69 / 100
What is cgo and what are its performance implications?
Correct! Well done.
Incorrect.
The correct answer is B) A mechanism to call C code from Go; crossing the Go/C boundary has overhead (goroutine stack switch, GC root reporting) and complicates builds
B
Correct Answer
A mechanism to call C code from Go; crossing the Go/C boundary has overhead (goroutine stack switch, GC root reporting) and complicates builds
Explanation
cgo enables calling C libraries. Each cgo call must switch from a goroutine stack to an OS thread stack. This adds ~200ns overhead per call and disables cross-compilation.
Progress
69/100