From assembler to C++: structure and optimization of CGo ☠️
summary
Explains how Go's goroutine scheduler and the CGo bridge between Go and C/C++ work, focusing on how memory allocations are tracked and how data is marshaled between the languages. Covers implementation and optimization techniques down to assembly-level details to improve CGo performance.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 1:54SIG problem motivation
- 2:38Talk structure
- 3:22Why SIG is slow
- 6:28SIG call hierarchy
- 7:31Calling C from Go components
- 9:41Building simplest FAST SIG
- 12:10Go stack types
- 16:04Getting system stack
- 17:52FAST SIG with stack switch
- 21:44FAST SIG verification
- 22:49Go-C parameter exchange
- 27:33Heap problem solution
- 29:16Optimizing struct passing
- 33:12Primitive types handling
- 34:59Packed struct issues
- 36:47Memory management leaks
- 38:12FAST SIG vs SIG comparison
- 39:38Q&A








