Skip to content

Commit 381d023

Browse files
Refatorings and Fixings
1 parent 5942952 commit 381d023

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/jmh/java/org/javarosa/benchmarks/ExternalDataInstanceBuildBenchmark.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.javarosa.core.reference.InvalidReferenceException;
1414
import org.javarosa.xml.util.InvalidStructureException;
1515
import org.javarosa.xml.util.UnfullfilledRequirementsException;
16+
import org.openjdk.jmh.annotations.Benchmark;
1617
import org.openjdk.jmh.annotations.Level;
1718
import org.openjdk.jmh.annotations.Param;
1819
import org.openjdk.jmh.annotations.Scope;
@@ -33,11 +34,11 @@ public static class ExternalDataInstanceState {
3334
public int noOfQuestions = 1;
3435
public int noOfInternalSecondaryInstances = 0;
3536
@Param({"50", "5000"})
36-
public int noOf2ndryInstanceElements = 1;
37+
public int noOf2ndryInstanceElements = 100;
3738
@Param({"1"})
3839
public int noOfQuestionGroups = 1;
3940
@Param({"50"})
40-
public int noOfExternalSecondaryInstances = 1;
41+
public int noOfExternalSecondaryInstances = 10;
4142
@Setup(Level.Trial)
4243
public void initialize() throws IOException {
4344
Map<String, Path> externalInstanceFiles = BenchmarkUtils.generateExternalSecondaryInstances(noOfQuestions, noOfQuestionGroups, noOfInternalSecondaryInstances, noOfExternalSecondaryInstances, noOf2ndryInstanceElements);
@@ -49,7 +50,7 @@ public void initialize() throws IOException {
4950

5051
}
5152

52-
//@Benchmark
53+
@Benchmark
5354
public void runBenchmark(ExternalDataInstanceState state, Blackhole bh)
5455
throws IOException, XmlPullParserException, InvalidReferenceException,
5556
UnfullfilledRequirementsException, InvalidStructureException {

src/jmh/java/org/javarosa/benchmarks/FormEntryControllerAnswerQuestion.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public void benchmarkAnswerOne(FormControllerAnswerQuestionState state) throws R
127127
} else {
128128
throw new RuntimeException("Form controller not in a question index");
129129
}
130-
state.formEntryController.jumpToIndex(FormIndex.createBeginningOfFormIndex());
131130
}
132131

133132
private class AnswerCurrentQuestionAction {

src/jmh/java/org/javarosa/benchmarks/TreeElementParserBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void initialize() throws IOException {
4949
}
5050
}
5151

52-
//@Benchmark
52+
@Benchmark
5353
public void runBenchmark(TreeElementParserBenchmarkState state, Blackhole bh) throws IOException, UnfullfilledRequirementsException, XmlPullParserException, InvalidStructureException {
5454
TreeElement documentRootTreeElement = parse(state.xFormFile);
5555
bh.consume(documentRootTreeElement);

src/jmh/java/org/javarosa/benchmarks/XFormParserBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void initialize() throws IOException {
4545
}
4646
}
4747

48-
//@Benchmark
48+
@Benchmark
4949
public void
5050
runBenchmark(XFormParserBenchmarkState state, Blackhole bh)
5151
throws IOException {

0 commit comments

Comments
 (0)