You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/06/04 20:25:15 UTC

[GitHub] [commons-math] XenoAmess opened a new pull request #142: use subList().clear instead of a loop of remove(0)

XenoAmess opened a new pull request #142:
URL: https://github.com/apache/commons-math/pull/142


   use subList().clear instead of a loop of remove(0)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-math] XenoAmess commented on pull request #142: use subList().clear instead of a loop of remove(0)

Posted by GitBox <gi...@apache.org>.
XenoAmess commented on pull request #142:
URL: https://github.com/apache/commons-math/pull/142#issuecomment-640047088


   Hi. do I need a performance benchmark for this pr too?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-math] asfgit closed pull request #142: use subList().clear instead of a loop of remove(0)

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #142:
URL: https://github.com/apache/commons-math/pull/142


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [commons-math] XenoAmess commented on pull request #142: use subList().clear instead of a loop of remove(0)

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [commons-math] coveralls commented on pull request #142: use subList().clear instead of a loop of remove(0)

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #142:
URL: https://github.com/apache/commons-math/pull/142#issuecomment-639113152


   
   [![Coverage Status](https://coveralls.io/builds/31248052/badge)](https://coveralls.io/builds/31248052)
   
   Coverage remained the same at 90.56% when pulling **5603fb701bf83c49ff2096b99674a738d36319aa on XenoAmess:use_subList().clear** into **715d89d2625b09915feb1dd1b60270842eeffb7a on apache:master**.
   


----------------------------------------------------------------
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:
users@infra.apache.org