From 4ebc5853b1d5e2f8756df5d9b1805152d29b1f75 Mon Sep 17 00:00:00 2001 From: BAMOE CI Date: Wed, 20 Dec 2023 06:39:38 +0100 Subject: [PATCH] [incubator-kie-issues#781] Fix as per PR suggestion --- .../feel/infixexecutors/FEELAddExecutorBenchmark.java | 9 ++++----- .../feel/infixexecutors/FEELAndExecutorBenchmark.java | 9 ++++----- .../feel/infixexecutors/FEELDivExecutorBenchmark.java | 9 ++++----- .../dmn/feel/infixexecutors/FEELEqExecutorBenchmark.java | 9 ++++----- .../dmn/feel/infixexecutors/FEELGtExecutorBenchmark.java | 9 ++++----- .../feel/infixexecutors/FEELGteExecutorBenchmark.java | 9 ++++----- .../infixexecutors/FEELInfixExecutorBenchmarkUtils.java | 9 ++++----- .../dmn/feel/infixexecutors/FEELLtExecutorBenchmark.java | 9 ++++----- .../feel/infixexecutors/FEELLteExecutorBenchmark.java | 9 ++++----- .../feel/infixexecutors/FEELMultExecutorBenchmark.java | 9 ++++----- .../dmn/feel/infixexecutors/FEELNeExecutorBenchmark.java | 9 ++++----- .../dmn/feel/infixexecutors/FEELOrExecutorBenchmark.java | 9 ++++----- .../feel/infixexecutors/FEELPowExecutorBenchmark.java | 9 ++++----- .../feel/infixexecutors/FEELSubExecutorBenchmark.java | 9 ++++----- 14 files changed, 56 insertions(+), 70 deletions(-) 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 518a43ea..cfd017e3 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getObjectArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELAddExecutorBenchmark { private AddExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"String String", "Duration Duration", "OffsetDateTime Duration", "int int"}) private String argsType; @@ -49,11 +48,11 @@ public class FEELAddExecutorBenchmark { public void setup() { executor = AddExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getMap(argsType); + values = getObjectArray(argsType); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 05806ffe..1517e2d0 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELAndExecutorBenchmark { private AndExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"true true", "true false", "false true", "false false"}) private String args; @@ -49,11 +48,11 @@ public class FEELAndExecutorBenchmark { public void setup() { executor = AndExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 7097382c..a4f56110 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getObjectArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELDivExecutorBenchmark { private DivExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"Duration int", "Duration Duration", "ChronoPeriod int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELDivExecutorBenchmark { public void setup() { executor = DivExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getMap(args); + values = getObjectArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 e70b3fff..770090b8 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELEqExecutorBenchmark { private EqExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"Duration int", "Duration Duration", "ChronoPeriod int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELEqExecutorBenchmark { public void setup() { executor = EqExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 0fb4fafc..d16b87dc 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELGtExecutorBenchmark { private GtExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"String String", "Duration Duration", "int int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELGtExecutorBenchmark { public void setup() { executor = GtExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 3756b0e8..444c2a3b 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELGteExecutorBenchmark { private GteExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"String String", "Duration Duration", "int int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELGteExecutorBenchmark { public void setup() { executor = GteExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELInfixExecutorBenchmarkUtils.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELInfixExecutorBenchmarkUtils.java index 61d7bb8c..6b9ad783 100644 --- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELInfixExecutorBenchmarkUtils.java +++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/feel/infixexecutors/FEELInfixExecutorBenchmarkUtils.java @@ -23,7 +23,6 @@ import java.time.chrono.ChronoLocalDate; import java.time.chrono.ChronoPeriod; import java.time.temporal.ChronoUnit; -import java.util.Map; public class FEELInfixExecutorBenchmarkUtils { @@ -31,18 +30,18 @@ public class FEELInfixExecutorBenchmarkUtils { private FEELInfixExecutorBenchmarkUtils() { } - static Map getMap(String types) { + static Object[] getObjectArray(String types) { String[] parsedTypes = types.split(" "); String leftType = parsedTypes[0]; String rightType = parsedTypes[1]; - return Map.of("a", getObject(leftType, 1), "b", getObject(rightType, 2)); + return new Object[]{getObject(leftType, 1), getObject(rightType, 2)}; } - static Map getBooleanMap(String args) { + static Object[] getBooleanArray(String args) { String[] parsedArgs = args.split(" "); String leftArg = parsedArgs[0]; String rightArg = parsedArgs[1]; - return Map.of("a", Boolean.valueOf(leftArg), "b", Boolean.valueOf(rightArg)); + return new Object[]{Boolean.valueOf(leftArg), Boolean.valueOf(rightArg)}; } private static Object getObject(String type, int value) { 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 780ab03a..37be3a40 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELLtExecutorBenchmark { private LtExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"String String", "Duration Duration", "int int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELLtExecutorBenchmark { public void setup() { executor = LtExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 875ac1d3..e2fca220 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELLteExecutorBenchmark { private LteExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"String String", "Duration Duration", "int int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELLteExecutorBenchmark { public void setup() { executor = LteExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 ae36703d..629b647a 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getObjectArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELMultExecutorBenchmark { private MultExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"Duration int", "Duration Duration", "ChronoPeriod int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELMultExecutorBenchmark { public void setup() { executor = MultExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getMap(args); + values = getObjectArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 bb143f2c..abae1421 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELNeExecutorBenchmark { private NeExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"Duration int", "Duration Duration", "ChronoPeriod int", "ChronoPeriod ChronoPeriod"}) private String args; @@ -49,11 +48,11 @@ public class FEELNeExecutorBenchmark { public void setup() { executor = NeExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 c0cb7689..666d86cf 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getBooleanArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELOrExecutorBenchmark { private OrExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"true true", "true false", "false true", "false false"}) private String args; @@ -49,11 +48,11 @@ public class FEELOrExecutorBenchmark { public void setup() { executor = OrExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getBooleanMap(args); + values = getBooleanArray(args); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("a"), map.get("b"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 5ea41af5..8c98b118 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getObjectArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELPowExecutorBenchmark { private PowExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"int int"}) private String argsType; @@ -49,11 +48,11 @@ public class FEELPowExecutorBenchmark { public void setup() { executor = PowExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getMap(argsType); + values = getObjectArray(argsType); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("b"), map.get("a"), ctx); + return executor.evaluate(values[0], values[1], ctx); } } 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 97628644..3a429b36 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 @@ -24,10 +24,9 @@ import org.kie.dmn.feel.util.ClassLoaderUtil; import org.openjdk.jmh.annotations.*; -import java.util.Map; import java.util.concurrent.TimeUnit; -import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getMap; +import static org.drools.benchmarks.dmn.feel.infixexecutors.FEELInfixExecutorBenchmarkUtils.getObjectArray; @Warmup(iterations = 10) @Measurement(iterations = 50) @@ -39,7 +38,7 @@ public class FEELSubExecutorBenchmark { private SubExecutor executor; private EvaluationContext ctx; - private Map map; + private Object[] values; @Param({"String String", "Duration Duration", "OffsetDateTime Duration", "int int"}) private String argsType; @@ -49,11 +48,11 @@ public class FEELSubExecutorBenchmark { public void setup() { executor = SubExecutor.instance(); ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null); - map = getMap(argsType); + values = getObjectArray(argsType); } @Benchmark public Object evaluate() { - return executor.evaluate(map.get("b"), map.get("a"), ctx); + return executor.evaluate(values[1], values[0], ctx); } }