Hacker News new | ask | show | jobs
by mappu 32 days ago
It was somewhat slow about a decade ago - you can see

- (2015, Go 1.5) Calls cost about 170ns https://www.cockroachlabs.com/blog/the-cost-and-complexity-o...

- (2017, Go 1.8) Cgo speedup by 50% https://go.dev/doc/go1.8#cgoperf

- (2023, Go 1.21) Calls cost about 40ns https://shane.ai/posts/cgo-performance-in-go1.21/

- (2026, Go 1.26) Cgo speedup by another 30% https://go.dev/doc/go1.26#faster-cgo-calls

A current benchmark shows a Cgo function call as costing about 25 ns. https://gist.github.com/DeedleFake/2f50b02c0708484c66d182533...