3 ms·
> Thus, cgo has an overhead because it performs a stack switch, not thread switch. > It saves and restores all registers when C function is called, while it's
by fragmede 9y ago
> Thus, cgo has an overhead because it performs a stack switch, not thread switch.
> It saves and restores all registers when C function is called, while it's not required when Go function or assembly function is called.
https://stackoverflow.com/a/37962500 https://stackoverflow.com/a/37962500