Fix datastore benchmark 38/89438/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Apr 2020 10:10:25 +0000 (12:10 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Apr 2020 18:56:48 +0000 (20:56 +0200)
The benchmark slid into disrepair, fix it up again and shorten
its run length.

Change-Id: I874c0979615f289ee726e4b6926b6d9d8aba5184
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/benchmark-data-store/pom.xml
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryWriteTransactionBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/BenchmarkModel.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryBrokerWriteTransactionBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithSameThreadedExecutorBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java

index 3c16bc2..1c4dea6 100644 (file)
@@ -22,7 +22,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <packaging>jar</packaging>
 
   <properties>
-    <spotbugs.skip>true</spotbugs.skip>
+    <odlparent.spotbugs.skip>true</odlparent.spotbugs.skip>
   </properties>
 
   <dependencies>
@@ -33,12 +33,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.openjdk.jmh</groupId>
       <artifactId>jmh-core</artifactId>
-      <version>1.21</version>
-    </dependency>
-    <dependency>
-      <groupId>org.openjdk.jmh</groupId>
-      <artifactId>jmh-generator-annprocess</artifactId>
-      <version>1.21</version>
+      <version>1.23</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal</groupId>
@@ -57,6 +52,18 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <build>
     <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <annotationProcessorPaths>
+            <dependency>
+              <groupId>org.openjdk.jmh</groupId>
+              <artifactId>jmh-generator-annprocess</artifactId>
+              <version>1.23</version>
+            </dependency>
+          </annotationProcessorPaths>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
index a2414d7..1a20e42 100644 (file)
@@ -15,7 +15,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 
 public abstract class AbstractInMemoryWriteTransactionBenchmark {
     protected static final int OUTER_LIST_100K = 100000;
@@ -36,8 +36,8 @@ public abstract class AbstractInMemoryWriteTransactionBenchmark {
         return paths;
     }
 
-    protected static final int WARMUP_ITERATIONS = 20;
-    protected static final int MEASUREMENT_ITERATIONS = 20;
+    protected static final int WARMUP_ITERATIONS = 6;
+    protected static final int MEASUREMENT_ITERATIONS = 6;
 
     protected static final MapNode ONE_ITEM_INNER_LIST = initInnerListItems(1);
     protected static final MapNode TWO_ITEM_INNER_LIST = initInnerListItems(2);
@@ -73,7 +73,7 @@ public abstract class AbstractInMemoryWriteTransactionBenchmark {
         return outerListItems;
     }
 
-    protected SchemaContext schemaContext;
+    protected EffectiveModelContext schemaContext;
 
     public abstract void setUp() throws Exception;
 
index 20e1074..e1effd9 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.controller.md.sal.dom.store.benchmark;
 
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 /**
@@ -36,7 +36,7 @@ public final class BenchmarkModel {
     private BenchmarkModel() {
     }
 
-    public static SchemaContext createTestContext() {
+    public static EffectiveModelContext createTestContext() {
         return YangParserTestUtils.parseYangResources(BenchmarkModel.class, DATASTORE_TEST_YANG);
     }
 }
index a0a096e..eeeebc8 100644 (file)
@@ -32,7 +32,7 @@ import org.openjdk.jmh.annotations.State;
 @OutputTimeUnit(TimeUnit.MILLISECONDS)
 @Fork(1)
 public class InMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryBrokerWriteTransactionBenchmark {
-    private ListeningExecutorService executor;
+    private ListeningExecutorService executor = null;
 
     @Setup(Level.Trial)
     @Override
@@ -50,8 +50,8 @@ public class InMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryBro
 
         domBroker = new SerializedDOMDataBroker(datastores, executor);
         schemaContext = BenchmarkModel.createTestContext();
-        configStore.onGlobalContextUpdated(schemaContext);
-        operStore.onGlobalContextUpdated(schemaContext);
+        configStore.onModelContextUpdated(schemaContext);
+        operStore.onModelContextUpdated(schemaContext);
         initTestNode();
     }
 
index 2e236c5..9d28598 100644 (file)
@@ -49,7 +49,7 @@ public class InMemoryDataStoreWithSameThreadedExecutorBenchmark
 
         domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor);
         schemaContext = BenchmarkModel.createTestContext();
-        domStore.onGlobalContextUpdated(schemaContext);
+        domStore.onModelContextUpdated(schemaContext);
         initTestNode();
     }
 
index c614085..937fc67 100644 (file)
@@ -39,7 +39,7 @@ public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemory
     public void setUp() throws Exception {
         domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", Executors.newSingleThreadExecutor());
         schemaContext = BenchmarkModel.createTestContext();
-        domStore.onGlobalContextUpdated(schemaContext);
+        domStore.onModelContextUpdated(schemaContext);
         initTestNode();
     }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.