changeset 48:7bdc65de6416

JMH Core Benchmarks subproject.
author shade
date Tue, 28 May 2013 13:36:18 +0400
parents e841c952e578
children a7e36b1ee004
files jmh-core-benchmarks/pom.xml jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/InvocationBench.java jmh-core-it/pom.xml pom.xml
diffstat 4 files changed, 240 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-benchmarks/pom.xml	Tue May 28 13:36:18 2013 +0400
@@ -0,0 +1,135 @@
+<!--
+Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+
+This code is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 only, as
+published by the Free Software Foundation.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the LICENSE file that accompanied this code.
+
+This code is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+version 2 for more details (a copy is included in the LICENSE file that
+accompanied this code).
+
+You should have received a copy of the GNU General Public License version
+2 along with this work; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+or visit www.oracle.com if you need additional information or have any
+questions.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.openjdk.jmh</groupId>
+    <artifactId>jmh-core-benchmarks</artifactId>
+    <packaging>jar</packaging>
+    <version>1.0-SNAPSHOT</version>
+    <name>JMH Core Benchmarks</name>
+
+    <organization>
+        <name>Oracle</name>
+        <url>http://openjdk.java.net/</url>
+    </organization>
+    <inceptionYear>2012</inceptionYear>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-core</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+    <prerequisites>
+        <maven>3.0</maven>
+    </prerequisites>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.0</version>
+                <configuration>
+                    <compilerVersion>1.6</compilerVersion>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.14.1</version>
+                <configuration>
+                    <forkMode>always</forkMode>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>2.0</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>microbenchmarks</finalName>
+                            <transformers>
+                                <transformer
+                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>org.openjdk.jmh.Main</mainClass>
+                                </transformer>
+                            </transformers>
+                            <filters>
+                                <!-- Remove annotation processor files -->
+                                <filter>
+                                    <artifact>oracle.micro:MicroBenchmarkAnnotationProcessor</artifact>
+                                    <excludes>
+                                        <exclude>*/**</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>com.mycila.maven-license-plugin</groupId>
+                <artifactId>maven-license-plugin</artifactId>
+                <version>1.10.b1</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>format</goal>
+                        </goals>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <header>file:///${project.basedir}/../src/license/gpl_cpe/header.txt</header>
+                            <skipExistingHeaders>false</skipExistingHeaders>
+                            <strictCheck>true</strictCheck>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/benchmarks/InvocationBench.java	Tue May 28 13:36:18 2013 +0400
@@ -0,0 +1,103 @@
+/**
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.benchmarks;
+
+import org.openjdk.jmh.annotations.BenchmarkType;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+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.TearDown;
+
+import java.util.concurrent.TimeUnit;
+
+public class InvocationBench {
+
+    @State(Scope.Benchmark)
+    public static class BenchmarkSetupTeardown {
+        @Setup(Level.Invocation)
+        public void setup() {
+            // do nothing
+        }
+
+        @TearDown(Level.Invocation)
+        public void tearDown() {
+            // do nothing
+        }
+    }
+
+    @State(Scope.Thread)
+    public static class ThreadSetupTeardown {
+        @Setup(Level.Invocation)
+        public void setup() {
+            // do nothing
+        }
+
+        @TearDown(Level.Invocation)
+        public void tearDown() {
+            // do nothing
+        }
+    }
+
+    @State(Scope.Group)
+    public static class GroupSetupTeardown {
+        @Setup(Level.Invocation)
+        public void setup() {
+            // do nothing
+        }
+
+        @TearDown(Level.Invocation)
+        public void tearDown() {
+            // do nothing
+        }
+    }
+
+    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+    public void raw() {
+        // do nothing
+    }
+
+    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+    public void benchmark(BenchmarkSetupTeardown g) {
+        // do nothing
+    }
+
+    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+    public void group(BenchmarkSetupTeardown g) {
+        // do nothing
+    }
+
+    @GenerateMicroBenchmark(BenchmarkType.AverageTimePerOp)
+    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+    public void thread(BenchmarkSetupTeardown g) {
+        // do nothing
+    }
+
+}
--- a/jmh-core-it/pom.xml	Tue May 28 13:07:03 2013 +0400
+++ b/jmh-core-it/pom.xml	Tue May 28 13:36:18 2013 +0400
@@ -30,7 +30,7 @@
     <artifactId>jmh-core-it</artifactId>
     <packaging>jar</packaging>
     <version>1.0-SNAPSHOT</version>
-    <name>JMH Integration Tests</name>
+    <name>JMH Core Integration Tests</name>
 
     <organization>
         <name>Oracle</name>
--- a/pom.xml	Tue May 28 13:07:03 2013 +0400
+++ b/pom.xml	Tue May 28 13:36:18 2013 +0400
@@ -44,6 +44,7 @@
     <modules>
         <module>jmh-core</module>
         <module>jmh-core-it</module>
+        <module>jmh-core-benchmarks</module>
         <module>jmh-samples</module>
         <module>jmh-simple-benchmark-archetype</module>
     </modules>