Re:Making a Go program 70% faster by avoiding common mistakes
by Cthulhu_ on Thursday March 17, 2016 @11:30AM
(#11304935)
Yeah, I'd like to be in the 'not worry about such things' school of thought; personally I don't like the re-calling of methods all the time, because it doesn't look elegant, but in terms of performance it shouldn't matter - I'd like to think the compiler can do some optimizations there. Of course, the compiler may not realize or want to assume the result of the methods are the same for every loop. But still, it should be possible for it to infer that, and optimize this developer oversight.
[ Parent
| on HN ]
Re:Making a Go program 70% faster by avoiding common mistakes
by JoeAltmaier on Thursday March 17, 2016 @11:54AM
(#11305138)
For instance if Itoa were a const method (is that a Go thing?) the compiler can make the optimization automatically.