News for hackers. Stuff that matters.
Re:Branchless Coding in Go by tkinom on Wednesday May 05, 2021 @06:12PM (#27056486)
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"....

Re:Branchless Coding in Go by gnum4n on Thursday May 06, 2021 @11:47AM (#27065027)
If 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.