@Override
    public void optimize(RankingExpression expression, ContextIndex context, OptimizationReport report) {
        if (!isEnabled()) return;

        this.report = report;

        if (context.size() > GBDTNode.MAX_VARIABLES) {
            report.note("Can not optimize expressions referencing more than " + GBDTNode.MAX_VARIABLES + " features: " +
                        expression + " has " + context.size());
            return;
        }

        expression.setRoot(optimize(expression.getRoot(), context));
        report.note("GBDT tree optimization done");
    }
Optimizes this by replacing GBDT sub-expressions by GBDTNodes. These optimized expressions <b>must</b> be
executed using an instance of {@link com.yahoo.searchlib.rankingexpression.evaluation.ArrayContext} as context.
These thread locally reusable contexts must be created from the ranking expression <i>before</i> the ranking
expression is optimized.

@param expression the expression to destructively optimize
@param context    a fast lookup context created from the given expression
@param report     the optimization report to which actions of this is logged
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/gbdtoptimization/GBDTOptimizer.java