2 ms·
> (and this will later be optimized by the compiler of course) Do not underestimate this part. It can take a surprising amount of effort to get these things r
by fooker 8y ago
> (and this will later be optimized by the compiler of course)
Do not underestimate this part. It can take a surprising amount of effort to get these things right and performant.
- GrayShade 8y agohttp://wiki.c2.com/?SufficientlySmartCompiler http://wiki.c2.com/?SufficientlySmartCompiler
- runeks 8y agoI wanted to ask OP about this part specifically, so I’ll write my questions here. a) how do you plan to do this? b) will the optimization still kick in if you name the return value something else than “a”? c) what if “a” is an argument passed to the function that calls “multiplyBy2”? Then doing an in-place update would modify the value of “a” for some other function that has also been passed “a” as an argument.