private Context copyForEvaluation(Context contextPrototype) {
        if (contextPrototype instanceof AbstractArrayContext) // optimized - contains name to index map
            return ((AbstractArrayContext)contextPrototype).clone();
        else if (contextPrototype instanceof MapContext) // Unoptimized - nothing to keep
            return new MapContext();
        else
            throw new RuntimeException("Unknown context type " + contextPrototype.getClass());
    }
Two small benchmarks of ranking expression evaluation

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