[incubator-kie-issues#1973] Create DMN-Efesto benchmarks (#294)
* [incubator-kie-issues#1973] Introducing dmn efesto benchmarks. Minor refactoring of other benchmarks. Fixing some generated models
* [incubator-kie-issues#1973] Implemented efesto runtime benchmarks
---------
Co-authored-by: Gabriele-Cardosi <gabriele.cardosi@ibm.com>
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/DMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/DMNProvider.java
index f7c45b4..7cfcfb9 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/DMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/DMNProvider.java
@@ -31,9 +31,19 @@
String getDMN();
/**
+ *
+ * @return the model name of the generated model
+ */
+ String getModelName();
+
+ /**
* Returns DMN that contains specified number of core elements (e.g. decisions, business knowledge model, etc.).
* @param numberOfElements Required number of core elements in resulting DRL.
* @return String representation of the generated DMN file.
*/
String getDMN(int numberOfElements);
+
+ default String getFormattedDefinitions(String modelName) {
+ return String.format("<definitions id=\"%1$s\" name=\"%1$s\"\n", modelName);
+ }
}
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/BusinessKnowledgeModelDMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/BusinessKnowledgeModelDMNProvider.java
index f998979..21b9f5c 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/BusinessKnowledgeModelDMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/BusinessKnowledgeModelDMNProvider.java
@@ -23,17 +23,24 @@
public class BusinessKnowledgeModelDMNProvider implements DMNProvider {
+ private static final String MODEL_NAME = "business-knowledge-model";
+
@Override
public String getDMN() {
return getDMN(1);
}
@Override
+ public String getModelName() {
+ return MODEL_NAME;
+ }
+
+ @Override
public String getDMN(int numberOfElements) {
final StringBuilder dmnBuilder = new StringBuilder();
dmnBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- dmnBuilder.append("<definitions id=\"business-knowledge-model\" name=\"business-knowledge-model\"\n");
+ dmnBuilder.append(getFormattedDefinitions(MODEL_NAME));
dmnBuilder.append(" namespace=\"https://github.com/kiegroup/kie-dmn\"\n");
dmnBuilder.append(" xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\"\n");
dmnBuilder.append(" xmlns:feel=\"http://www.omg.org/spec/FEEL/20140401\">\n");
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/ContextDMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/ContextDMNProvider.java
index 8c80f19..5f3d72a 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/ContextDMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/ContextDMNProvider.java
@@ -23,21 +23,29 @@
public class ContextDMNProvider implements DMNProvider {
+ private static final String MODEL_NAME = "dmn-context";
+
@Override
public String getDMN() {
return getDMN(1);
}
@Override
+ public String getModelName() {
+ return MODEL_NAME;
+ }
+
+ @Override
public String getDMN(int numberOfElements) {
final StringBuilder dmnBuilder = new StringBuilder();
dmnBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- dmnBuilder.append("<definitions id=\"dmn-context\" name=\"dmn-context\"\n");
+ dmnBuilder.append(getFormattedDefinitions(MODEL_NAME));
dmnBuilder.append(" namespace=\"https://github.com/kiegroup/kie-dmn\"\n");
dmnBuilder.append(" xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\"\n");
- dmnBuilder.append(" xmlns:feel=\"http://www.omg.org/spec/FEEL/20140401\">\n");
- dmnBuilder.append(" xsi:schemaLocation=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd http://www.omg.org/spec/DMN/20151101/dmn.xsd \"\n");
+ dmnBuilder.append(" xmlns:feel=\"http://www.omg.org/spec/FEEL/20140401\"\n");
+ dmnBuilder.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n");
+ dmnBuilder.append(" xsi:schemaLocation=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd http://www.omg.org/spec/DMN/20151101/dmn.xsd \"\n>");
for (int i = 0; i < numberOfElements; i++) {
dmnBuilder.append(getContext(i));
@@ -51,7 +59,7 @@
private String getContext(final int index) {
final StringBuilder contextBuilder = new StringBuilder();
contextBuilder.append(" <decision id=\"decision" + index + "\" name=\"decision" + index + "\">\n");
- contextBuilder.append(" <variable name=\"DecisionVar" + index + "\" typeRef=\"feel:context\"/>\n");
+ contextBuilder.append(" <variable name=\"decision" + index + "\" typeRef=\"feel:context\"/>\n");
contextBuilder.append(" <context>\n");
contextBuilder.append(" <contextEntry>\n");
contextBuilder.append(" <variable name=\"entry" + index + "-1\" typeRef=\"feel:string\"/>\n");
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DTNoGapsNoOverlapsDMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DTNoGapsNoOverlapsDMNProvider.java
index 427945e..9f6497e 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DTNoGapsNoOverlapsDMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DTNoGapsNoOverlapsDMNProvider.java
@@ -25,17 +25,24 @@
public class DTNoGapsNoOverlapsDMNProvider implements DMNProvider {
+ private static final String MODEL_NAME = "dt-nogapsnooverlaps";
+
@Override
public String getDMN() {
return getDMN(1);
}
@Override
+ public String getModelName() {
+ return MODEL_NAME;
+ }
+
+ @Override
public String getDMN(int param) {
final StringBuilder dmnBuilder = new StringBuilder();
dmnBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- dmnBuilder.append("<definitions id=\"dt-nogapsnooverlaps\" name=\"dt-nogapsnooverlaps\"\n");
+ dmnBuilder.append(getFormattedDefinitions(MODEL_NAME));
dmnBuilder.append(" namespace=\"https://github.com/kiegroup/kie-dmn\"\n");
dmnBuilder.append(" xmlns=\"http://www.omg.org/spec/DMN/20180521/MODEL/\"\n");
dmnBuilder.append(" xmlns:feel=\"http://www.omg.org/spec/DMN/20180521/FEEL/\">\n");
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionDMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionDMNProvider.java
index 98a2a3b..6d014b5 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionDMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionDMNProvider.java
@@ -23,17 +23,24 @@
public class DecisionDMNProvider implements DMNProvider {
+ private static final String MODEL_NAME = "decision";
+
@Override
public String getDMN() {
return getDMN(1);
}
@Override
+ public String getModelName() {
+ return MODEL_NAME;
+ }
+
+ @Override
public String getDMN(int numberOfElements) {
final StringBuilder dmnBuilder = new StringBuilder();
dmnBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- dmnBuilder.append("<definitions id=\"decision\" name=\"decision\"\n");
+ dmnBuilder.append(getFormattedDefinitions(MODEL_NAME));
dmnBuilder.append(" namespace=\"https://github.com/kiegroup/drools/kie-dmn\"\n");
dmnBuilder.append(" xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\"\n");
dmnBuilder.append(" xmlns:feel=\"http://www.omg.org/spec/FEEL/20140401\">\n");
@@ -52,8 +59,8 @@
private String getDecision(final int index) {
final StringBuilder decisionBuilder = new StringBuilder();
- decisionBuilder.append(" <decision id=\"decision" + index + "\" name=\"decision" + index + "\">\n");
- decisionBuilder.append(" <variable name=\"variable" + index + "\" typeRef=\"feel:string\"/>\n");
+ decisionBuilder.append( " <decision id=\"decision" + index + "\" name=\"decision" + index + "\">\n");
+ decisionBuilder.append(" <variable name=\"decision" + index + "\" typeRef=\"feel:string\"/>\n");
decisionBuilder.append(" <informationRequirement>\n");
decisionBuilder.append(" <requiredInput href=\"#i_FullName\"/>\n");
decisionBuilder.append(" </informationRequirement>\n");
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTableDMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTableDMNProvider.java
index 1a126a7..bee0b8d 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTableDMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTableDMNProvider.java
@@ -23,17 +23,24 @@
public class DecisionTableDMNProvider implements DMNProvider {
+ private static final String MODEL_NAME = "decision-table";
+
@Override
public String getDMN() {
return getDMN(1);
}
@Override
+ public String getModelName() {
+ return MODEL_NAME;
+ }
+
+ @Override
public String getDMN(int numberOfTableRules) {
final StringBuilder dmnBuilder = new StringBuilder();
dmnBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- dmnBuilder.append("<definitions id=\"decision-table-id\" name=\"decision-table-name\"\n");
+ dmnBuilder.append(getFormattedDefinitions(MODEL_NAME));
dmnBuilder.append(" namespace=\"https://github.com/kiegroup/kie-dmn\"\n");
dmnBuilder.append(" xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\"\n");
dmnBuilder.append(" xmlns:feel=\"http://www.omg.org/spec/FEEL/20140401\"\n");
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTablesDMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTablesDMNProvider.java
index 7b7a5f1..3f6b471 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTablesDMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/DecisionTablesDMNProvider.java
@@ -23,17 +23,24 @@
public class DecisionTablesDMNProvider implements DMNProvider {
+ private static final String MODEL_NAME = "decision-tables";
+
@Override
public String getDMN() {
return getDMN(1);
}
@Override
+ public String getModelName() {
+ return MODEL_NAME;
+ }
+
+ @Override
public String getDMN(int numberOfElements) {
final StringBuilder dmnBuilder = new StringBuilder();
dmnBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- dmnBuilder.append("<definitions id=\"decision-table-id\" name=\"decision-table-name\"\n");
+ dmnBuilder.append(getFormattedDefinitions(MODEL_NAME));
dmnBuilder.append(" namespace=\"https://github.com/kiegroup/kie-dmn\"\n");
dmnBuilder.append("xmlns=\"http://www.omg.org/spec/DMN/20180521/MODEL/\" ");
dmnBuilder.append("xmlns:triso=\"http://www.trisotech.com/2015/triso/modeling\" ");
diff --git a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/TriangularNumHardDMNProvider.java b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/TriangularNumHardDMNProvider.java
index 701d83d..e3bac41 100644
--- a/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/TriangularNumHardDMNProvider.java
+++ b/drools-benchmarks-parent/drools-benchmarks-common/src/main/java/org/drools/benchmarks/common/providers/dmn/TriangularNumHardDMNProvider.java
@@ -26,17 +26,24 @@
public class TriangularNumHardDMNProvider implements DMNProvider {
+ private static final String MODEL_NAME = "dmn-triangular";
+
@Override
public String getDMN() {
return getDMN(1);
}
@Override
+ public String getModelName() {
+ return MODEL_NAME;
+ }
+
+ @Override
public String getDMN(int numberOfElements) {
final StringBuilder dmnBuilder = new StringBuilder();
dmnBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- dmnBuilder.append("<definitions id=\"dmn-triangular\" name=\"dmn-triangular\"\n");
+ dmnBuilder.append(getFormattedDefinitions(MODEL_NAME));
dmnBuilder.append(" namespace=\"https://github.com/kiegroup/kie-dmn\"\n");
dmnBuilder.append(" xmlns=\"http://www.omg.org/spec/DMN/20180521/MODEL/\"\n");
dmnBuilder.append(" xmlns:feel=\"http://www.omg.org/spec/DMN/20180521/FEEL/\">\n");
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/DMNEfestoAbstractBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/DMNEfestoAbstractBenchmark.java
new file mode 100644
index 0000000..1c96322
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/DMNEfestoAbstractBenchmark.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.drools.benchmarks.dmn.efesto;
+
+import org.drools.benchmarks.common.AbstractBenchmark;
+import org.drools.io.ClassPathResource;
+import org.kie.api.io.Resource;
+import org.kie.dmn.core.api.DMNFactory;
+import org.kie.dmn.efesto.compiler.model.DmnCompilationContext;
+import org.kie.efesto.common.api.identifiers.LocalUri;
+import org.kie.efesto.common.api.identifiers.ModelLocalUriId;
+import org.kie.efesto.common.api.model.EfestoCompilationContext;
+import org.kie.efesto.common.api.model.GeneratedModelResource;
+import org.kie.efesto.common.api.model.GeneratedResources;
+import org.kie.efesto.common.core.storage.ContextStorage;
+import org.kie.efesto.compilationmanager.api.model.EfestoFileResource;
+import org.kie.efesto.compilationmanager.api.model.EfestoFileSetResource;
+import org.kie.efesto.compilationmanager.api.model.EfestoInputStreamResource;
+import org.kie.efesto.compilationmanager.api.model.EfestoStringResource;
+import org.kie.efesto.compilationmanager.api.service.CompilationManager;
+import org.kie.efesto.compilationmanager.api.utils.SPIUtils;
+import org.kie.efesto.runtimemanager.api.model.BaseEfestoInput;
+import org.kie.efesto.runtimemanager.api.model.EfestoInput;
+import org.kie.efesto.runtimemanager.api.model.EfestoLocalRuntimeContext;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.kie.efesto.runtimemanager.api.service.RuntimeManager;
+import org.kie.efesto.runtimemanager.core.model.EfestoRuntimeContextUtils;
+import org.kie.memorycompiler.KieMemoryCompiler;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+@SuppressWarnings({"rawtypes", "unchecked"})
+public abstract class DMNEfestoAbstractBenchmark extends AbstractBenchmark {
+
+ private static final KieMemoryCompiler.MemoryCompilerClassLoader memoryCompilerClassLoader =
+ new KieMemoryCompiler.MemoryCompilerClassLoader(Thread.currentThread().getContextClassLoader());
+ private static final CompilationManager compilationManager =
+ SPIUtils.getCompilationManager(true).orElseThrow(() -> new RuntimeException("Compilation Manager not " +
+ "available"));
+ private static final RuntimeManager runtimeManager =
+ org.kie.efesto.runtimemanager.api.utils.SPIUtils.getRuntimeManager(true).orElseThrow(() -> new RuntimeException("Runtime Manager not available"));
+
+ protected Map<String, GeneratedResources> generatedResources;
+ protected ModelLocalUriId modelLocalUriId;
+ protected EfestoLocalRuntimeContext runtimeContext;
+ protected Map<String, Object> inputData;
+
+ protected EfestoLocalRuntimeContext getRuntimeContext(Map<String, GeneratedResources> generatedResourcesMap, ModelLocalUriId modelLocalUriId) {
+ EfestoLocalRuntimeContext toReturn = (EfestoLocalRuntimeContext) ContextStorage.getEfestoRuntimeContext(modelLocalUriId);
+ if (toReturn == null) {
+ toReturn = EfestoRuntimeContextUtils.buildWithParentClassLoader(memoryCompilerClassLoader, generatedResourcesMap);
+ ContextStorage.putEfestoRuntimeContext(modelLocalUriId, toReturn);
+
+ }
+ return toReturn;
+ }
+
+ protected Collection<EfestoOutput> evaluate(EfestoLocalRuntimeContext runtimeContext,
+ ModelLocalUriId modelLocalUriId, Map<String, Object> inputData) {
+ EfestoInput<Map<String, Object>> inputDMN = new BaseEfestoInput<>(modelLocalUriId, inputData);
+ return runtimeManager.evaluateInput(runtimeContext, inputDMN);
+ }
+
+ protected ModelLocalUriId getModelLocalUriId(Map<String, GeneratedResources> generatedResources) {
+ List<GeneratedModelResource> generatedModelResources = generatedResources.get("dmn")
+ .stream()
+ .filter(GeneratedModelResource.class::isInstance)
+ .map(GeneratedModelResource.class::cast)
+ .toList();
+ if (generatedModelResources.size() != 1) {
+ throw new IllegalStateException("Expected exactly one generated model resource");
+ }
+ return generatedModelResources.get(0).getModelLocalUriId();
+ }
+
+ protected HashMap getInputData() {
+ return new HashMap<>(DMNFactory.newContext().getAll());
+ }
+
+ protected Map<String, GeneratedResources> compileModel(Resource dmnResource, String model) {
+ try (InputStream inputStream = dmnResource.getInputStream()) {
+ EfestoInputStreamResource toProcessDmn = new EfestoInputStreamResource(inputStream, model + ".dmn");
+ EfestoCompilationContext dmnCompilationContext = DmnCompilationContext.buildWithParentClassLoader(memoryCompilerClassLoader);
+ compilationManager.processResource(dmnCompilationContext, toProcessDmn);
+ return dmnCompilationContext.getGeneratedResourcesMap();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected Map<String, GeneratedResources> compileModel(String dmn, String model) {
+ ModelLocalUriId dmnModelLocalUriId = new ModelLocalUriId(LocalUri.Root.append("dmn").append(model));
+ EfestoStringResource toProcessDmn = new EfestoStringResource(dmn, dmnModelLocalUriId);
+ EfestoCompilationContext dmnCompilationContext = DmnCompilationContext.buildWithParentClassLoader(memoryCompilerClassLoader);
+ compilationManager.processResource(dmnCompilationContext, toProcessDmn);
+ return dmnCompilationContext.getGeneratedResourcesMap();
+ }
+
+ protected Map<String, GeneratedResources> compileModel(File dmnFile) {
+ EfestoFileResource toProcessDmn = new EfestoFileResource(dmnFile);
+ EfestoCompilationContext dmnCompilationContext = DmnCompilationContext.buildWithParentClassLoader(memoryCompilerClassLoader);
+ compilationManager.processResource(dmnCompilationContext, toProcessDmn);
+ return dmnCompilationContext.getGeneratedResourcesMap();
+ }
+
+ protected Map<String, GeneratedResources> compileModels(Collection<File> dmnFiles) {
+ ModelLocalUriId dmnModelLocalUriId = new ModelLocalUriId(LocalUri.Root.append("dmn").append("benchmarks"));
+ EfestoFileSetResource toProcessDmn = new EfestoFileSetResource(new HashSet<>(dmnFiles), dmnModelLocalUriId);
+ EfestoCompilationContext dmnCompilationContext = DmnCompilationContext.buildWithParentClassLoader(memoryCompilerClassLoader);
+ compilationManager.processResource(dmnCompilationContext, toProcessDmn);
+ return dmnCompilationContext.getGeneratedResourcesMap();
+ }
+
+ protected String getDmnContent(String resourceName) {
+ final Resource dmnResource = new ClassPathResource(resourceName);
+ try (InputStream inputStream = dmnResource.getInputStream()) {
+ return new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationBusinessKnowledgeModelBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationBusinessKnowledgeModelBenchmark.java
new file mode 100644
index 0000000..eb2ed8a
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationBusinessKnowledgeModelBenchmark.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.compilation;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.BusinessKnowledgeModelDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.common.api.model.GeneratedResources;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@Warmup(iterations = 40, time = 2, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
+public class DMNCompilationBusinessKnowledgeModelBenchmark extends DMNEfestoAbstractBenchmark {
+
+ private String dmn;
+ private String modelName;
+
+ @Param({"3000"})
+ private int numberOfDecisionsWithBKM;
+
+ @Setup
+ @Override
+ public void setup() throws ProviderException {
+ DMNProvider dmnProvider = new BusinessKnowledgeModelDMNProvider();
+ dmn = dmnProvider.getDMN(numberOfDecisionsWithBKM);
+ modelName = dmnProvider.getModelName();
+ }
+
+ @Benchmark
+ public Map<String, GeneratedResources> testGetGeneratedResourcesMap() {
+ return compileModel(dmn, modelName);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationComplexDMNModelBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationComplexDMNModelBenchmark.java
new file mode 100644
index 0000000..6fc0fd0
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationComplexDMNModelBenchmark.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.compilation;
+
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.drools.io.ClassPathResource;
+import org.kie.api.io.Resource;
+import org.kie.efesto.common.api.model.GeneratedResources;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@Warmup(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
+public class DMNCompilationComplexDMNModelBenchmark extends DMNEfestoAbstractBenchmark {
+
+ private Resource dmnResource;
+
+ @Param({"dmn/ch11MODIFIED.dmn"})
+ private String resourceName;
+ private String modelName;
+
+ @Setup
+ @Override
+ public void setup() throws ProviderException {
+ dmnResource = new ClassPathResource(resourceName);
+ modelName = "ch11MODIFIED";
+ }
+
+ @Benchmark
+ public Map<String, GeneratedResources> testGetGeneratedResourcesMap() {
+ return compileModel(dmnResource, modelName);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationContextBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationContextBenchmark.java
new file mode 100644
index 0000000..f4aec2c
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationContextBenchmark.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.compilation;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.ContextDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.drools.io.ReaderResource;
+import org.kie.api.io.Resource;
+import org.kie.api.io.ResourceType;
+import org.kie.efesto.common.api.model.GeneratedResources;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.io.StringReader;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@Warmup(iterations = 40, time = 2, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
+public class DMNCompilationContextBenchmark extends DMNEfestoAbstractBenchmark {
+
+ private String dmn;
+ private Resource dmnResource;
+ private String modelName;
+
+ @Param({"3000"})
+ private int numberOfDecisionsWithContext;
+
+ @Setup
+ @Override
+ public void setup() throws ProviderException {
+ DMNProvider dmnProvider = new ContextDMNProvider();
+ dmn = dmnProvider.getDMN(numberOfDecisionsWithContext);
+ dmnResource = new ReaderResource(new StringReader(dmn))
+ .setResourceType(ResourceType.DMN)
+ .setSourcePath("dmnFile.dmn");
+ modelName = dmnProvider.getModelName();
+ }
+
+ @Benchmark
+ public Map<String, GeneratedResources> testGetGeneratedResourcesMap() {
+ return compileModel(dmnResource, modelName);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationDecisionBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationDecisionBenchmark.java
new file mode 100644
index 0000000..de46c1e
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationDecisionBenchmark.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.compilation;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.DecisionDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.drools.io.ReaderResource;
+import org.kie.api.io.Resource;
+import org.kie.api.io.ResourceType;
+import org.kie.efesto.common.api.model.GeneratedResources;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.io.StringReader;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@Warmup(iterations = 40, time = 2, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
+public class DMNCompilationDecisionBenchmark extends DMNEfestoAbstractBenchmark {
+
+ private String dmn;
+ private Resource dmnResource;
+ private String modelName;
+
+ @Param({"3000"})
+ private int numberOfDecisions;
+
+ @Setup
+ @Override
+ public void setup() throws ProviderException {
+ final DMNProvider dmnProvider = new DecisionDMNProvider();
+ dmn = dmnProvider.getDMN(numberOfDecisions);
+ dmnResource = new ReaderResource(new StringReader(dmn))
+ .setResourceType(ResourceType.DMN)
+ .setSourcePath("dmnFile.dmn");
+ modelName = dmnProvider.getModelName();
+ }
+
+ @Benchmark
+ public Map<String, GeneratedResources> testGetGeneratedResourcesMap() {
+ return compileModel(dmnResource, modelName);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationDecisionTableBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationDecisionTableBenchmark.java
new file mode 100644
index 0000000..47e56ad
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationDecisionTableBenchmark.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.compilation;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.DecisionTableDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.drools.io.ReaderResource;
+import org.kie.api.io.Resource;
+import org.kie.api.io.ResourceType;
+import org.kie.efesto.common.api.model.GeneratedResources;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.io.StringReader;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@Warmup(iterations = 40, time = 2, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
+public class DMNCompilationDecisionTableBenchmark extends DMNEfestoAbstractBenchmark {
+
+ private String dmn;
+ private Resource dmnResource;
+ private String modelName;
+
+ @Param({"3000"})
+ private int numberOfDecisionTableRules;
+
+ @Setup
+ @Override
+ public void setup() throws ProviderException {
+ final DMNProvider dmnProvider = new DecisionTableDMNProvider();
+ dmn = dmnProvider.getDMN(numberOfDecisionTableRules);
+ dmnResource = new ReaderResource(new StringReader(dmn))
+ .setResourceType(ResourceType.DMN)
+ .setSourcePath("dmnFile.dmn");
+ modelName = dmnProvider.getModelName();
+ }
+
+ @Benchmark
+ public Map<String, GeneratedResources> testGetGeneratedResourcesMap() {
+ return compileModel(dmnResource, modelName);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationMultipleBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationMultipleBenchmark.java
new file mode 100644
index 0000000..7e933b9
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/compilation/DMNCompilationMultipleBenchmark.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.compilation;
+
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.BusinessKnowledgeModelDMNProvider;
+import org.drools.benchmarks.common.providers.dmn.ContextDMNProvider;
+import org.drools.benchmarks.common.providers.dmn.DecisionDMNProvider;
+import org.drools.benchmarks.common.providers.dmn.DecisionTableDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.drools.io.ClassPathResource;
+import org.drools.io.ReaderResource;
+import org.kie.api.io.Resource;
+import org.kie.api.io.ResourceType;
+import org.kie.dmn.api.core.DMNRuntime;
+import org.kie.dmn.core.internal.utils.DMNRuntimeBuilder;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.io.StringReader;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@BenchmarkMode(Mode.AverageTime)
+@State(Scope.Thread)
+@Warmup(iterations = 40, time = 2, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 15, time = 2, timeUnit = TimeUnit.SECONDS)
+@OutputTimeUnit(TimeUnit.MILLISECONDS)
+public class DMNCompilationMultipleBenchmark extends DMNEfestoAbstractBenchmark {
+
+ private Resource resource1;
+
+ private String dmn1;
+ private String dmn2;
+ private String dmn3;
+ private String dmn4;
+
+ @Setup
+ public void setup() throws ProviderException {
+ resource1 = new ClassPathResource("dmn/ch11MODIFIED.dmn");
+ resource1.setResourceType(ResourceType.DMN);
+
+ dmn1 = new BusinessKnowledgeModelDMNProvider().getDMN(1000);
+ dmn2 = new DecisionTableDMNProvider().getDMN(1000);
+ dmn3 = new DecisionDMNProvider().getDMN(1000);
+ dmn4 = new ContextDMNProvider().getDMN(1000);
+ }
+
+ @Benchmark
+ public DMNRuntime createDMNRuntime() {
+ List<Resource> dmnResources = Arrays.asList(resource1,
+ getDMNResource(dmn1, "bkm.dmn"),
+ getDMNResource(dmn2, "decisionTable.dmn"),
+ getDMNResource(dmn3, "decision.dmn"),
+ getDMNResource(dmn4, "context.dmn"));
+ return DMNRuntimeBuilder.fromDefaults()
+ .buildConfiguration()
+ .fromResources(dmnResources)
+ .getOrElseThrow(e -> new RuntimeException("Error initializing DMNRuntime", e));
+ }
+
+ private Resource getDMNResource(String dmn, final String sourcePath) {
+ return new ReaderResource(new StringReader(dmn))
+ .setResourceType(ResourceType.DMN)
+ .setSourcePath(sourcePath);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateContextBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateContextBenchmark.java
new file mode 100644
index 0000000..d72a3bc
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateContextBenchmark.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.ContextDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Collection;
+
+@Warmup(iterations = 100)
+@Measurement(iterations = 50)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNEvaluateContextBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"1000"})
+ private int numberOfDecisionsWithContext;
+
+ @Setup
+ public void setupResource() {
+ final DMNProvider dmnProvider = new ContextDMNProvider();
+ String dmn = dmnProvider.getDMN(numberOfDecisionsWithContext);
+ String modelName = dmnProvider.getModelName();
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateContext() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionBenchmark.java
new file mode 100644
index 0000000..c13e017
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionBenchmark.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.DecisionDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Collection;
+
+@Warmup(iterations = 300)
+@Measurement(iterations = 50)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNEvaluateDecisionBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"1000"})
+ private int numberOfDecisions;
+
+ @Setup
+ public void setupResource() {
+ final DMNProvider dmnProvider = new DecisionDMNProvider();
+ String dmn = dmnProvider.getDMN(numberOfDecisions);
+ String modelName = dmnProvider.getModelName();
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ inputData.put("Full Name", "John Doe");
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateDecision() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionTableBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionTableBenchmark.java
new file mode 100644
index 0000000..020bb8d
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionTableBenchmark.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.DecisionTableDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.math.BigDecimal;
+import java.util.Collection;
+
+@Warmup(iterations = 40000)
+@Measurement(iterations = 5000)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNEvaluateDecisionTableBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"1000"})
+ private int numberOfDecisionTableRules;
+
+ @Setup
+ public void setupResource() {
+ final DMNProvider dmnProvider = new DecisionTableDMNProvider();
+ String dmn = dmnProvider.getDMN(numberOfDecisionTableRules);
+ String modelName = dmnProvider.getModelName();
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ inputData.put("Age", BigDecimal.valueOf(18));
+ inputData.put("RiskCategory", "Medium");
+ inputData.put("isAffordable", true);
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateDecisionTable() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionTablesSparseBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionTablesSparseBenchmark.java
new file mode 100644
index 0000000..50bb590
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateDecisionTablesSparseBenchmark.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.DecisionTablesDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Collection;
+import java.util.Scanner;
+
+@Warmup(iterations = 200)
+@Measurement(iterations = 50)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNEvaluateDecisionTablesSparseBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"500"})
+ private int numberOfElements;
+ @Param({"1", "2", "50"})
+ private int sparseness;
+
+
+ public static void main(String[] args) throws Exception {
+ try (Scanner scanner = new Scanner(System.in)) {
+ DMNEvaluateDecisionTablesSparseBenchmark instance = new DMNEvaluateDecisionTablesSparseBenchmark();
+ instance.numberOfElements = 500;
+ instance.sparseness = 50;
+ instance.setupResource();
+ instance.setup();
+ System.out.println("Press ENTER to continue... ");
+ scanner.nextLine();
+ for (int i = 0; i < 1_000; i++) {
+ instance.evaluateDecision();
+ }
+ }
+ }
+
+ @Setup
+ public void setupResource() {
+ final DMNProvider dmnProvider = new DecisionTablesDMNProvider();
+ String dmn = dmnProvider.getDMN(numberOfElements);
+ String modelName = dmnProvider.getModelName();
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ for (int i = 0; i < numberOfElements; i++) {
+ if (i % sparseness == 0) {
+ inputData.put("leftInput_" + i, "a");
+ inputData.put("rightInput_" + i, "x");
+ }
+ }
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateDecision() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
+
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateFewLiteralDecisionBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateFewLiteralDecisionBenchmark.java
new file mode 100644
index 0000000..6308bf0
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateFewLiteralDecisionBenchmark.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.DecisionDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Collection;
+
+@Warmup(iterations = 5000)
+@Measurement(iterations = 2000)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNEvaluateFewLiteralDecisionBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"20", "50", "100"})
+ private int numberOfDecisions;
+
+
+ @Setup
+ public void setupResource() {
+ final DMNProvider dmnProvider = new DecisionDMNProvider();
+ String dmn = dmnProvider.getDMN(numberOfDecisions);
+ String modelName = dmnProvider.getModelName();
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ inputData.put("Full Name", "John Doe");
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateDecision() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluatePojoInputBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluatePojoInputBenchmark.java
new file mode 100644
index 0000000..53bd3ca
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluatePojoInputBenchmark.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.drools.benchmarks.dmn.runtime.model.Person;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Collection;
+import java.util.concurrent.atomic.AtomicInteger;
+
+@Warmup(iterations = 40000)
+@Measurement(iterations = 10000)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNEvaluatePojoInputBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"dmn/pojo-input.dmn"})
+ private String resourceName;
+
+
+ @State(Scope.Benchmark)
+ public static class IterationCounter {
+ public static AtomicInteger value = new AtomicInteger(0);
+ }
+
+ @Setup
+ public void setupResource() {
+ String dmn = getDmnContent(resourceName);
+ String modelName = "20180731-pr1997";
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ inputData.put("a Person", new Person("John", "Doe", IterationCounter.value.incrementAndGet()));
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateModel() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateTriangularNumHardBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateTriangularNumHardBenchmark.java
new file mode 100644
index 0000000..cabc8bf
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNEvaluateTriangularNumHardBenchmark.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.TriangularNumHardDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Collection;
+
+@Warmup(iterations = 50000)
+@Measurement(iterations = 10000)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNEvaluateTriangularNumHardBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"20", "50"})
+ private int numberOfDecisionsWithContext;
+
+ @Setup
+ public void setupResource() {
+ final DMNProvider dmnProvider = new TriangularNumHardDMNProvider();
+ String dmn = dmnProvider.getDMN(numberOfDecisionsWithContext);
+ String modelName = dmnProvider.getModelName();
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateContext() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNRuntimeBKModelBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNRuntimeBKModelBenchmark.java
new file mode 100644
index 0000000..1bcce63
--- /dev/null
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/efesto/runtime/DMNRuntimeBKModelBenchmark.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.drools.benchmarks.dmn.efesto.runtime;
+
+import org.drools.benchmarks.common.DMNProvider;
+import org.drools.benchmarks.common.ProviderException;
+import org.drools.benchmarks.common.providers.dmn.BusinessKnowledgeModelDMNProvider;
+import org.drools.benchmarks.dmn.efesto.DMNEfestoAbstractBenchmark;
+import org.kie.efesto.runtimemanager.api.model.EfestoOutput;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Measurement;
+import org.openjdk.jmh.annotations.Param;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.Warmup;
+
+import java.util.Collection;
+
+@Warmup(iterations = 100)
+@Measurement(iterations = 50)
+@Fork(value = 0)
+@SuppressWarnings({"unchecked", "rawtypes"})
+public class DMNRuntimeBKModelBenchmark extends DMNEfestoAbstractBenchmark {
+
+ @Param({"1000"})
+ private int numberOfDecisionsWithBKM;
+
+ @Setup
+ public void setupResource() {
+ final DMNProvider dmnProvider = new BusinessKnowledgeModelDMNProvider();
+ String dmn = dmnProvider.getDMN(numberOfDecisionsWithBKM);
+ String modelName = dmnProvider.getModelName();
+ generatedResources = compileModel(dmn, modelName);
+ modelLocalUriId = getModelLocalUriId(generatedResources);
+ }
+
+ @Setup(Level.Iteration)
+ @Override
+ public void setup() throws ProviderException {
+ inputData = getInputData();
+ runtimeContext = getRuntimeContext(generatedResources, modelLocalUriId);
+ }
+
+ @Benchmark
+ public Collection<EfestoOutput> evaluateBusinessKnowledgeModel() {
+ return evaluate(runtimeContext, modelLocalUriId, inputData);
+ }
+}
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateContextBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateContextBenchmark.java
index a60a128..3bbd5fe 100644
--- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateContextBenchmark.java
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateContextBenchmark.java
@@ -61,7 +61,7 @@
.setResourceType(ResourceType.DMN)
.setSourcePath("dmnFile.dmn");
dmnRuntime = DMNUtil.getDMNRuntimeWithResources(false, dmnResource);
- dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", "dmn-context");
+ dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", dmnProvider.getModelName());
}
@Setup(Level.Iteration)
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionBenchmark.java
index 0c21b5c..5196620 100644
--- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionBenchmark.java
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionBenchmark.java
@@ -61,7 +61,7 @@
.setResourceType(ResourceType.DMN)
.setSourcePath("dmnFile.dmn");
dmnRuntime = DMNUtil.getDMNRuntimeWithResources(false, dmnResource);
- dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn", "decision");
+ dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn", dmnProvider.getModelName());
}
@Setup(Level.Iteration)
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTableBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTableBenchmark.java
index b8455c6..cf18aef 100644
--- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTableBenchmark.java
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTableBenchmark.java
@@ -62,7 +62,7 @@
.setResourceType(ResourceType.DMN)
.setSourcePath("dmnFile.dmn");
dmnRuntime = DMNUtil.getDMNRuntimeWithResources(false, dmnResource);
- dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", "decision-table-name");
+ dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", dmnProvider.getModelName());
}
@Setup(Level.Iteration)
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTablesSparseBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTablesSparseBenchmark.java
index c8604ca..0718110 100644
--- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTablesSparseBenchmark.java
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateDecisionTablesSparseBenchmark.java
@@ -85,7 +85,7 @@
.setResourceType(ResourceType.DMN)
.setSourcePath("dmnFile.dmn");
dmnRuntime = DMNUtil.getDMNRuntimeWithResources(false, dmnResource);
- dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", "decision-table-name");
+ dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", dmnProvider.getModelName());
}
@Setup(Level.Iteration)
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateFewLiteralDecisionBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateFewLiteralDecisionBenchmark.java
index e4aaa9e..b151976 100644
--- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateFewLiteralDecisionBenchmark.java
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateFewLiteralDecisionBenchmark.java
@@ -61,7 +61,7 @@
.setResourceType(ResourceType.DMN)
.setSourcePath("dmnFile.dmn");
dmnRuntime = DMNUtil.getDMNRuntimeWithResources(false, dmnResource);
- dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn", "decision");
+ dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn", dmnProvider.getModelName());
}
@Setup(Level.Iteration)
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateTriangularNumHardBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateTriangularNumHardBenchmark.java
index 0cedce1..ba804e7 100644
--- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateTriangularNumHardBenchmark.java
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/runtime/DMNEvaluateTriangularNumHardBenchmark.java
@@ -61,7 +61,7 @@
.setResourceType(ResourceType.DMN)
.setSourcePath("dmnFile.dmn");
dmnRuntime = DMNUtil.getDMNRuntimeWithResources(false, dmnResource);
- dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", "dmn-triangular");
+ dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", dmnProvider.getModelName());
}
@Setup(Level.Iteration)
diff --git a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/validation/DTNoGapsNoOverlapsBenchmark.java b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/validation/DTNoGapsNoOverlapsBenchmark.java
index 897b967..e554084 100644
--- a/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/validation/DTNoGapsNoOverlapsBenchmark.java
+++ b/drools-benchmarks-parent/drools-benchmarks/src/main/java/org/drools/benchmarks/dmn/validation/DTNoGapsNoOverlapsBenchmark.java
@@ -93,7 +93,7 @@
.setResourceType(ResourceType.DMN)
.setSourcePath("dmnFile.dmn");
dmnRuntime = DMNUtil.getDMNRuntimeWithResources(false, dmnResource);
- dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", "dt-nogapsnooverlaps");
+ dmnModel = dmnRuntime.getModel("https://github.com/kiegroup/kie-dmn", dmnProvider.getModelName());
}
@Setup(Level.Iteration)
diff --git a/drools-benchmarks-parent/pom.xml b/drools-benchmarks-parent/pom.xml
index b58e803..b48b607 100644
--- a/drools-benchmarks-parent/pom.xml
+++ b/drools-benchmarks-parent/pom.xml
@@ -64,6 +64,17 @@
<artifactId>kie-pmml-dependencies</artifactId>
<version>${version.org.drools}</version>
</dependency>
+ <!-- TO BE MOVED INSIDE kie-dmn-bom -->
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-dmn-efesto-compilation</artifactId>
+ <version>${version.org.drools}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-dmn-efesto-runtime</artifactId>
+ <version>${version.org.drools}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -114,6 +125,14 @@
</dependency>
<dependency>
<groupId>org.kie</groupId>
+ <artifactId>kie-dmn-efesto-compilation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-dmn-efesto-runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.kie</groupId>
<artifactId>kie-pmml-dependencies</artifactId>
</dependency>
<dependency>