private static void testNew() throws InterruptedException {
  X.println("Testing new...");
  int MAX=1000000;
  byte[][] arrs=new byte[MAX][];
  System.gc();
  GridTimer t=new GridTimer("new");
  byte v=0;
  int mem=1024;
  for (int i=0; i < MAX; i++) {
    arrs[i]=new byte[mem];
    arrs[i][RAND.nextInt(mem)]=(byte)RAND.nextInt(mem);
    v=arrs[i][RAND.nextInt(mem)];
  }
  X.println("New [time=" + t.stop() + "ms, v="+ v+ ']');
  Thread.sleep(5000L);
}

private static void testNew ( ) throws InterruptedException { X . println ( "Testing new..." ) ; int MAX = 1000000 ; byte [ ] [ ] arrs = new byte [ MAX ] [ ] ; System . gc ( ) ; GridTimer t = new GridTimer ( "new" ) ; byte v = 0 ; int mem = 1024 ; for ( int i = 0 ; i < MAX ; i ++ ) { arrs [ i ] = new byte [ mem ] ; arrs [ i ] [ RAND . nextInt ( mem ) ] = ( byte ) RAND . nextInt ( mem ) ; v = arrs [ i ] [ RAND . nextInt ( mem ) ] ; } X . println ( "New [time=" + t . stop ( ) + "ms, v=" + v + ']' ) ; Thread . sleep ( 5000L ) ; }
test unsafe vs . new .
