maobaolong commented on PR #2080:
URL: 
https://github.com/apache/incubator-uniffle/pull/2080#issuecomment-2309162111

   @jerqi I use a sequential data to test it, the following is my test code.
   
   ```
   import jdk.nashorn.internal.ir.debug.ObjectSizeCalculator;
   import org.junit.Test;
   import org.roaringbitmap.longlong.Roaring64NavigableMap;
   
   public class TestRoaringbitmap2 {
   
       @Test
       public void test() {
           Roaring64NavigableMap rrSingle = Roaring64NavigableMap.bitmapOf();
           for (long i = 0; i < 8000_0000; i++) {
               rrSingle.addLong(i);
           }
           System.out.printf("heap cost of Roaring64NavigableMap with 
8000_0000: %s(MiB) %n"
               , ObjectSizeCalculator.getObjectSize(rrSingle) / 1024 / 1024);
           Roaring64NavigableMap[] rr = new Roaring64NavigableMap[10];
           System.out.printf("heap cost of empty Roaring64NavigableMap[] array 
: %s(Byte) %n"
               , ObjectSizeCalculator.getObjectSize(rr));
           for (int i = 0; i < 10; i++) {
               rr[i] = Roaring64NavigableMap.bitmapOf();
               for (long j = 0; j < 800_0000; j++) {
                   rr[i].addLong(j);
               }
           }
           System.out.printf("heap cost of Roaring64NavigableMap with one 
800_0000: %s(KiB) %n"
               , ObjectSizeCalculator.getObjectSize(rr[0]) / 1024);
           System.out.printf("heap cost of Roaring64NavigableMap with ten 
800_0000: %s(MiB) %n"
               , ObjectSizeCalculator.getObjectSize(rr) / 1024 / 1024);
       }
   }
   ```
   
   - The output is
   ```
   heap cost of Roaring64NavigableMap with 8000_0000: 9(MiB) 
   heap cost of empty Roaring64NavigableMap[] array : 56(Byte) 
   heap cost of Roaring64NavigableMap with one 800_0000: 990(KiB) 
   heap cost of Roaring64NavigableMap with ten 800_0000: 9(MiB) 
   ```
   
   It shows that heap cost of Roaring64NavigableMap with 8000_0000 is equals 
with ten 800_0000.


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

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to