public void testHashMapPutRemove(){
  Map<String,String> map=new HashMap<>(LOAD_CNT);
  info("Starting standard HashMap performance test...");
  long cnt=0;
  long start=System.currentTimeMillis();
  boolean rmv=false;
  boolean done=false;
  while (!done) {
    for (    Map.Entry<String,T3<String,byte[],byte[]>> e : kvMap.entrySet()) {
      String key=e.getKey();
      T3<String,byte[],byte[]> t=e.getValue();
      try {
        if (rmv)         map.remove(key);
 else         map.put(key,t.get1());
      }
 catch (      GridOffHeapOutOfMemoryException ex) {
        error("Map put failed for count: " + cnt,ex);
        throw ex;
      }
      if (cnt > 0 && cnt % 10000000 == 0) {
        long cur=System.currentTimeMillis();
        long throughput=cnt * 1000 / (cur - start);
        X.println("Insert [cnt=" + cnt + ", ops/sec="+ throughput+ ']');
        if ((cur - start) > dur) {
          done=true;
          break;
        }
      }
      cnt++;
    }
    rmv=!rmv;
  }
}

public void testHashMapPutRemove ( ) { Map < String , String > map = new HashMap < > ( LOAD_CNT ) ; info ( "Starting standard HashMap performance test..." ) ; long cnt = 0 ; long start = System . currentTimeMillis ( ) ; boolean rmv = false ; boolean done = false ; while ( ! done ) { for ( Map . Entry < String , T3 < String , byte [ ] , byte [ ] > > e : kvMap . entrySet ( ) ) { String key = e . getKey ( ) ; T3 < String , byte [ ] , byte [ ] > t = e . getValue ( ) ; try { if ( rmv ) map . remove ( key ) ; else map . put ( key , t . get1 ( ) ) ; } catch ( GridOffHeapOutOfMemoryException ex ) { error ( "Map put failed for count: " + cnt , ex ) ; throw ex ; } if ( cnt > 0 && cnt % 10000000 == 0 ) { long cur = System . currentTimeMillis ( ) ; long throughput = cnt * 1000 / ( cur - start ) ; X . println ( "Insert [cnt=" + cnt + ", ops/sec=" + throughput + ']' ) ; if ( ( cur - start ) > dur ) { done = true ; break ; } } cnt ++ ; } rmv = ! rmv ; } }
test plain hash map .
