Am 17.12.2015 um 08:54 schrieb Aleksey Shipilev:
On 12/17/2015 02:34 AM, Ulf wrote:
I'm wondering why moving the increment operation to an extra line wound
enhance performance.
Because C1 is very straightforward, and code movement like that is a
poor man's instruction scheduling, that pads out the data dependency
between index update and indexed access.
Thanks.
Shouldn't this simple optimization be addressed to javac?
Otherwise programmers always risk some performance when using the post-increment idiom, which IMHO
is good code style.
-Ulf