On Fri, Dec 2, 2016 at 2:55 AM, <nsa...@gmail.com> wrote: > Is there a summary somewhere of the general rules determining when > do functions get inlined? > > Specifically, it should always be a good decision to inline a > function that is only called from one place in the code (that is, a > non-reused function). Do such (at least non-exported ones) > functions get inlined by the compiler?
it's usually a good idea, but not absolutely always (https://github.com/golang/go/issues/17566#issuecomment-262145248). The general rules for the current inliner can be seen in the function ishairy in cmd/compile/interna/gc/inl.go. There is active work on improving the inliner, so any specific answers are going to be version-specific. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.