-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
Description
The Go binding calls a C ABI binding, which calls the Qt C++ functions. Overall, it's somewhat efficient.
But to comply with the common C ABI, there are some places where data types must be converted, or moved onto the heap. This could be optimized in some cases.
Ideas:
- Bypass malloc/free for zero-length strings and arrays
- When returning a QString, have C++ fill in a Go-provided buffer, instead of copying the data twice
- Current: C malloc - C strcpy - Cgo boundary - Go malloc - Go memcpy - Cgo boundary - C free - Cgo boundary - Go epilogue
- Proposal: C calls go_malloc - Cgo boundary - Go malloc - Cgo boundary - C strcpy - Cgo boundary - Go epilogue
- Same 3x boundaries