XenoAmess commented on pull request #142:
URL: https://github.com/apache/commons-math/pull/142#issuecomment-639303187


   Well IMO this can improve the speed as:
   1. in most times the list is an ArrayList here in your codes.
   2. when in original codes, each time you remove(0) it calls a 
`System.arraycopy`, means the array is copied `extra` times.
   3. when use sublist.clear(), it actually called list.removeRange, which do 
only one `System.arraycopy`, thus far faster.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to