question: int useCache ( SolrCache sc , int numGets , int maxKey , int seed ) { int ret = 0 ; Random r = new Random ( seed ) ; for ( int i = 0 ; i < numGets ; i ++ ) { Integer k = r . nextInt ( maxKey ) ; Integer v = ( Integer ) sc . get ( k ) ; if ( v == null ) { sc . put ( k , k ) ; ret ++ ; } } return ret ; }
target:  public void testPerf() { doPerfTest(1000000, 100000, 200000); // big cache, warmup doPerfTest(2000000, 100000, 200000); // big cache doPerfTest(2000000, 100000, 120000);  // smaller key space increases distance between oldest, newest and makes the first passes less effective. doPerfTest(6000000, 1000, 2000);    // small cache, smaller hit rate doPerfTest(6000000, 1000, 1200);    // small cache, bigger hit rate }