3 ms·
It depends on how long the time you spend in your c function is. cgo has a substantial overhead for calling. I tend to prefer just writing ASM functions for cri
by zbobet2012 2y ago
It depends on how long the time you spend in your c function is. cgo has a substantial overhead for calling. I tend to prefer just writing ASM functions for critical path code. You can use libraries like https://github.com/mmcloughlin/avo https://github.com/mmcloughlin/avo to make it easier to write/maintain.
- bborud 2y agoHave you tried writing Go assembler instead of x86? https://go.dev/doc/asm https://go.dev/doc/asm (I'm not suggesting, merely asking since I haven't written any assembler for Intel for 30+ years and I have never written Go assembler)