3 ms·
Does go support "__builtin_expect" similar to gcc? I optimized tight loop of network packets forwarding code with "__builtin_expect" and "inline" to get rid of
by tkinom 5y ago
Does go support "__builtin_expect" similar to gcc?
I optimized tight loop of network packets forwarding code with "__builtin_expect" and "inline" to get rid of at most all the branch delays and able to get > 10X increase in performance.
Wonder if same method can be used with "go"....
- gnum4n 5y agoIf Go does have some kind of "__builtin_expect" equivalent, I can't find it. I'd say it probably doesn't exist. Even if it _did_ exist, the Go compiler authors would reserve it for internal use only, like they do with most other Go compiler directives.