[ 
https://issues.apache.org/jira/browse/MATH-1564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17246011#comment-17246011
 ] 

Alex Herbert commented on MATH-1564:
------------------------------------

The {{array.length}} is a public final member of the array set during 
initialisation:

[JLS 10.7 Array 
Members|https://docs.oracle.com/javase/specs/jls/se8/html/jls-10.html#jls-10.7]

So what you are doing is copying an int value locally rather than accessing it 
from memory. This is a micro optimisation. If there was a noticeable difference 
in runtime then this would be an easy target for the JIT compiler designers to 
optimise and I presume they already have.


> Minor improvement
> -----------------
>
>                 Key: MATH-1564
>                 URL: https://issues.apache.org/jira/browse/MATH-1564
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Arturo Bernal
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Minor improvement
>  * extra computations by getting the string size only once



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to