Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 to make it easier to write/maintain.


Have you tried writing Go assembler instead of x86?

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)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: