I was looking at a project in java and found a for
loop which was written like below:
for(int i=1; i
a.length
is not a calculation but merely an access to a field held within the array. That type of read operation is super fast.
If the code is part of a method which is called often enough, it is almost certain that the JIT compiler will do the optimisation you propose to make it even faster.
The potential speed difference is in nanoseconds here (probably without an "s").