keith-turner commented on PR #5432:
URL: https://github.com/apache/accumulo/pull/5432#issuecomment-2755566438

   Wrote this to experiment with these changes.   When `stuffToRemove` is an 
ArrayList this program takes around 16 seconds to removeAll.  When 
`stuffToRemove` is a HashSet it takes around 200ms to removeAll.
   
   
   ```
   import java.util.HashSet;
   import java.util.concurrent.TimeUnit;
   
   import com.google.common.collect.HashBasedTable;
   
   public class test {
     public static void main(String[] args) {
       for (int i = 0; i < 100; i++) {
         runTest();
       }
     }
   
     private static void runTest() {
       HashBasedTable<String,String,String> hbt = HashBasedTable.create();
   
       int v = 0;
       for (int r = 0; r < 10000; r++) {
         String row = String.format("%09d", r);
         for (int c = 0; c < 1000; c++) {
           String col = String.format("%09d", c);
           hbt.put(row, col, String.format("%09d", v++));
         }
       }
   
       var stuffToRemove = new HashSet<>();
   
       for (int c = 500; c < 1500; c++) {
         String col = String.format("%09d", c);
         stuffToRemove.add(col);
       }
   
       System.out.println("csize: " + hbt.columnKeySet().size());
       System.out.println("size: " + hbt.size());
   
       long t1 = System.nanoTime();
       hbt.columnKeySet().removeAll(stuffToRemove);
       long t2 = System.nanoTime();
   
       System.out.println(TimeUnit.NANOSECONDS.toMillis(t2 - t1));
     }
   }
   
   ```


-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to