private double benchmarkIterations(RankingExpression gbdt, Context contextPrototype, int iterations) {
        // This tries to simulate realistic use: The array context can be reused for a series of evaluations in a thread
        // but each evaluation binds a new set of values.
        double total=0;
        Context context = copyForEvaluation(contextPrototype);
        for (int i=0; i<iterations; i++) {
            context.put("LW_NEWS_SEARCHES_RATIO",(double)i);
            context.put("NEWS_USERS",(double)i/1000*1000);
            context.put("catid",100300102);
            total+=gbdt.evaluate(context).asDouble();
        }
        return total;
    }
Two small benchmarks of ranking expression evaluation

@author bratseth
searchlib/src/test/java/com/yahoo/searchlib/rankingexpression/evaluation/EvaluationBenchmark.java