Short Answer: Worrying about micro-optimizations like this is almost certainly pointless.
Slightly longer answer: Without knowing the type of x & y this question cannot be answered. There's a big difference between them being integers and being a large complicated class with overloaded operators.
If you really care, learn how to have the compiler output the assembly code and compare the two. Of course, then you'd need to look up the cost of each instruction for every processor the code might run on as well as consider any potential stalls, etc.
Suffice it to say that for integers they likely generate identical or almost identical code. For anything more complex where the generated code might be different the only real way to know which is better is to profile both, possibly under several different conditions, and use that measurement to determine which is better.
|