On Monday, 17 October 2016 09:15:33 UTC-4, Axel Wagner wrote:
> However, the compiler might be clever enough to optimize that out with 
> inlining and escape analysis. And indeed, I'm failing to trigger the 
> behavior with any simple testcase. So I might be wrong here. Would be 
> interested in an experts explanation as to if that reasoning is 
> systematically broken :)
The compiler is unlikely to be able to optimize the call because 
ioutil.devNull is always called indirectly through an io.Writer interface. 
 (If you knew statically you were calling devNull.Write, why make the 
call?)  But relative to the cost of making the dynamic call, the additional 
cost of passing a single integer parameter is very small---probably only a 
few percent.

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.

Reply via email to