amarkevich commented on issue #577: cxf-rt-rs-client: use ArrayList in 
ClientProxyImpl
URL: https://github.com/apache/cxf/pull/577#issuecomment-527800109
 
 
   its complex to count PathParam count because
   a) class level annotations [0..nc]
   b) method level annotations [0..nm]
   c) BeanParam with annotations [0..nb]
   Total [0..(nc+nm+nb)]
   0 is the best case for LinkedList.
   Add operation for LinkedList cause memory allocation
   
   Checked using https://github.com/DimitrisAndreou/memory-measurer
   ```
       public static void main(String[] arguments) {
           ArrayList<Object> al = new ArrayList<>();
           LinkedList<Object> ll = new LinkedList<>();
           System.out.println("size\tArrayList\tLinkedList");
           for (int i = 0; i < 11; ++i) {
               System.out.println(i + "\t" + MemoryMeasurer.measureBytes(al) + 
"\t" + MemoryMeasurer.measureBytes(ll));
               al.add(new Object());
               ll.add(new Object());
           }
       }
   
   ```
   Result:
   
   > size       ArrayList       LinkedList
   > 0  40      32
   > 1  96      72
   > 2  112     112
   > 3  128     152
   > 4  144     192
   > 5  160     232
   > 6  176     272
   > 7  192     312
   > 8  208     352
   > 9  224     392
   > 10 240     432
   
   and ArrayList structure inclined to cpu cache hit

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to