From 6497d89fe25b0627f9504165ba631e3efd8b1035 Mon Sep 17 00:00:00 2001 From: Gabriele-Cardosi Date: Wed, 5 Jun 2024 11:45:22 +0200 Subject: [PATCH] [incubator-kie-issues#1300] Fix broken DMN benchmarks --- .../drools/benchmarks/dmn/feel/AbstractFEELBenchmark.java | 5 +++-- .../benchmarks/dmn/feel/EvaluationContextImplBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELAddExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELAndExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELDivExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELEqExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELGtExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELGteExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELLtExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELLteExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELMultExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELNeExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELOrExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELPowExecutorBenchmark.java | 2 +- .../dmn/feel/infixexecutors/FEELSubExecutorBenchmark.java | 2 +- 15 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/AbstractFEELBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/AbstractFEELBenchmark.java index 544b534f..7571a727 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/AbstractFEELBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/AbstractFEELBenchmark.java @@ -25,6 +25,7 @@ import org.kie.dmn.feel.FEEL; import org.kie.dmn.feel.lang.CompiledExpression; +import org.kie.dmn.feel.lang.impl.FEELBuilder; import org.kie.dmn.feel.parser.feel11.profiles.DoCompileFEELProfile; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -50,8 +51,8 @@ public abstract class AbstractFEELBenchmark { @Setup() public void setupFEEL() { - feelInterpreted = FEEL.newInstance(); - feelCompiled = FEEL.newInstance(Collections.singletonList(new DoCompileFEELProfile())); + feelInterpreted = FEELBuilder.builder().build(); + feelCompiled = FEELBuilder.builder().withProfiles(Collections.singletonList(new DoCompileFEELProfile())).build(); compiledJavaExpression = compileExpression(getExpression()); compiledButInterpretedExpression = compileInterpretedExpression(getExpression()); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/EvaluationContextImplBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/EvaluationContextImplBenchmark.java index 57ee5884..a61b362c 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/EvaluationContextImplBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/EvaluationContextImplBenchmark.java @@ -44,7 +44,7 @@ public class EvaluationContextImplBenchmark { @Setup() public void setupFEEL() { - context = new EvaluationContextImpl(this.getClass().getClassLoader(), null); + context = new EvaluationContextImpl(this.getClass().getClassLoader(), null, null); context.enterFrame(); context.enterFrame(); context.enterFrame(); diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAddExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAddExecutorBenchmark.java index cfd017e3..41d0d7ae 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAddExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAddExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELAddExecutorBenchmark { @Setup public void setup() { executor = AddExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getObjectArray(argsType); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAndExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAndExecutorBenchmark.java index 1517e2d0..50a4346b 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAndExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELAndExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELAndExecutorBenchmark { @Setup public void setup() { executor = AndExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELDivExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELDivExecutorBenchmark.java index a4f56110..3080e4bd 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELDivExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELDivExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELDivExecutorBenchmark { @Setup public void setup() { executor = DivExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getObjectArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELEqExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELEqExecutorBenchmark.java index 770090b8..7b1a6a78 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELEqExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELEqExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELEqExecutorBenchmark { @Setup public void setup() { executor = EqExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGtExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGtExecutorBenchmark.java index d16b87dc..5eff2058 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGtExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGtExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELGtExecutorBenchmark { @Setup public void setup() { executor = GtExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGteExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGteExecutorBenchmark.java index 444c2a3b..a4de0d34 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGteExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELGteExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELGteExecutorBenchmark { @Setup public void setup() { executor = GteExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLtExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLtExecutorBenchmark.java index 37be3a40..40b8ce8c 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLtExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLtExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELLtExecutorBenchmark { @Setup public void setup() { executor = LtExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLteExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLteExecutorBenchmark.java index e2fca220..c9aebca1 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLteExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELLteExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELLteExecutorBenchmark { @Setup public void setup() { executor = LteExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELMultExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELMultExecutorBenchmark.java index 629b647a..5b68e335 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELMultExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELMultExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELMultExecutorBenchmark { @Setup public void setup() { executor = MultExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getObjectArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELNeExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELNeExecutorBenchmark.java index abae1421..153abf1e 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELNeExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELNeExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELNeExecutorBenchmark { @Setup public void setup() { executor = NeExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELOrExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELOrExecutorBenchmark.java index 666d86cf..c2d4fd9b 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELOrExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELOrExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELOrExecutorBenchmark { @Setup public void setup() { executor = OrExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getBooleanArray(args); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELPowExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELPowExecutorBenchmark.java index 8c98b118..3b5e4788 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELPowExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELPowExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELPowExecutorBenchmark { @Setup public void setup() { executor = PowExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getObjectArray(argsType); } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELSubExecutorBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELSubExecutorBenchmark.java index 3a429b36..732f8004 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELSubExecutorBenchmark.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELSubExecutorBenchmark.java @@ -47,7 +47,7 @@ public class FEELSubExecutorBenchmark { @Setup public void setup() { executor = SubExecutor.instance(); - ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); + ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null); values = getObjectArray(argsType); }