Skip to content

Commit

Permalink
[incubator-kie-issues#1300] Fix broken DMN benchmarks (#287)
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriele-Cardosi <[email protected]>
  • Loading branch information
gitgabrio and Gabriele-Cardosi authored Jun 5, 2024
1 parent d108dc0 commit 076b7a6
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.kie.dmn.feel.FEEL;
import org.kie.dmn.feel.lang.CompiledExpression;
import org.kie.dmn.feel.lang.impl.FEELBuilder;
import org.kie.dmn.feel.parser.feel11.profiles.DoCompileFEELProfile;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
Expand All @@ -50,8 +51,8 @@ public abstract class AbstractFEELBenchmark {

@Setup()
public void setupFEEL() {
feelInterpreted = FEEL.newInstance();
feelCompiled = FEEL.newInstance(Collections.singletonList(new DoCompileFEELProfile()));
feelInterpreted = FEELBuilder.builder().build();
feelCompiled = FEELBuilder.builder().withProfiles(Collections.singletonList(new DoCompileFEELProfile())).build();
compiledJavaExpression = compileExpression(getExpression());
compiledButInterpretedExpression = compileInterpretedExpression(getExpression());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class EvaluationContextImplBenchmark {

@Setup()
public void setupFEEL() {
context = new EvaluationContextImpl(this.getClass().getClassLoader(), null);
context = new EvaluationContextImpl(this.getClass().getClassLoader(), null, null);
context.enterFrame();
context.enterFrame();
context.enterFrame();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELAddExecutorBenchmark {
@Setup
public void setup() {
executor = AddExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getObjectArray(argsType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELAndExecutorBenchmark {
@Setup
public void setup() {
executor = AndExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELDivExecutorBenchmark {
@Setup
public void setup() {
executor = DivExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getObjectArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELEqExecutorBenchmark {
@Setup
public void setup() {
executor = EqExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELGtExecutorBenchmark {
@Setup
public void setup() {
executor = GtExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELGteExecutorBenchmark {
@Setup
public void setup() {
executor = GteExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELLtExecutorBenchmark {
@Setup
public void setup() {
executor = LtExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELLteExecutorBenchmark {
@Setup
public void setup() {
executor = LteExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELMultExecutorBenchmark {
@Setup
public void setup() {
executor = MultExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getObjectArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELNeExecutorBenchmark {
@Setup
public void setup() {
executor = NeExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELOrExecutorBenchmark {
@Setup
public void setup() {
executor = OrExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getBooleanArray(args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELPowExecutorBenchmark {
@Setup
public void setup() {
executor = PowExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getObjectArray(argsType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FEELSubExecutorBenchmark {
@Setup
public void setup() {
executor = SubExecutor.instance();
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null);
ctx = new EvaluationContextImpl(ClassLoaderUtil.findDefaultClassLoader(), null, null);
values = getObjectArray(argsType);
}

Expand Down

0 comments on commit 076b7a6

Please sign in to comment.