You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/03/27 10:45:16 UTC

[GitHub] [calcite] vlsi opened a new pull request #1880: Make ubenchmark clases executable from IDEA

vlsi opened a new pull request #1880: Make ubenchmark clases executable from IDEA
URL: https://github.com/apache/calcite/pull/1880
 
 
   This makes `ubenchmark / .main` classes executable from IDEA

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA

Posted by GitBox <gi...@apache.org>.
neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA
URL: https://github.com/apache/calcite/pull/1880#discussion_r399633618
 
 

 ##########
 File path: ubenchmark/build.gradle.kts
 ##########
 @@ -22,12 +22,29 @@ dependencies {
     // Make jmhCompileClasspath resolvable
     @Suppress("DEPRECATION")
     jmhCompileClasspath(platform(project(":bom")))
-    jmh(project(":core"))
-    jmh(project(":linq4j"))
-    jmh("com.google.guava:guava")
-    jmh("org.codehaus.janino:commons-compiler")
-    jmh("org.openjdk.jmh:jmh-core")
-    jmh("org.openjdk.jmh:jmh-generator-annprocess")
+    jmhImplementation(project(":core"))
+    jmhImplementation(project(":linq4j"))
+    jmhImplementation("com.google.guava:guava")
+    jmhImplementation("org.codehaus.janino:commons-compiler")
+    jmhImplementation("org.openjdk.jmh:jmh-core")
+    jmhImplementation("org.openjdk.jmh:jmh-generator-annprocess")
 }
 
 // See https://github.com/melix/jmh-gradle-plugin
+// Unfortunately, current jmh-gradle-plugin does not allow to cusomize jmh parameters from the
+// command line, so the workarounds are:
+// a) Build and execute the jar itself: ./gradlew jmhJar && java -jar build/libs/calcite-...jar JMH_OPTIONS
+// b) Execute benchmarks via .main() methods from IDE (you might want to activate "power save mode"
+//    in the IDE to minimize the impact of the IDE itself on the benchmark results)
+
+tasks.withType<JavaExec>().configureEach {
+    // Execution of .main methods from IDEA should re-generate benchmark classes if required
+    dependsOn("jmhCompileGeneratedClasses")
+    doFirst {
+        // At best jmh plugin should add the generated directories to the Gradle model, however,
+        // currently it builds the jar only :-/
+        // IntelliJ IDEA "execute main method" adds a JavaExec task, so we configure it
+        classpath(File(buildDir, "jmh-generated-classes"))
+        classpath(File(buildDir, "jmh-generated-resources"))
 
 Review comment:
   @vlsi I might mislead you, maybe that is my env problem. No rush to look into this, unless any one else comes into this trouble again.
   My idea version is the latest community one.
   ```
   IntelliJ IDEA 2019.3.3 (Community Edition)
   Build #IC-193.6494.35, built on February 11, 2020
   Runtime version: 11.0.5+10-b520.38 x86_64
   VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
   macOS 10.12.6
   GC: ParNew, ConcurrentMarkSweep
   Memory: 1981M
   Cores: 8
   Registry: 
   Non-Bundled Plugins: CheckStyle-IDEA, FindBugs-IDEA, Lombook Plugin, OdpsStudio, com.alibaba.p3c.smartfox, com.poratu.idea.plugins.tomcat, org.intellij.scala
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vlsi merged pull request #1880: Make ubenchmark clases executable from IDEA

Posted by GitBox <gi...@apache.org>.
vlsi merged pull request #1880: Make ubenchmark clases executable from IDEA
URL: https://github.com/apache/calcite/pull/1880
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA

Posted by GitBox <gi...@apache.org>.
neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA
URL: https://github.com/apache/calcite/pull/1880#discussion_r399361115
 
 

 ##########
 File path: ubenchmark/build.gradle.kts
 ##########
 @@ -22,12 +22,29 @@ dependencies {
     // Make jmhCompileClasspath resolvable
     @Suppress("DEPRECATION")
     jmhCompileClasspath(platform(project(":bom")))
-    jmh(project(":core"))
-    jmh(project(":linq4j"))
-    jmh("com.google.guava:guava")
-    jmh("org.codehaus.janino:commons-compiler")
-    jmh("org.openjdk.jmh:jmh-core")
-    jmh("org.openjdk.jmh:jmh-generator-annprocess")
+    jmhImplementation(project(":core"))
+    jmhImplementation(project(":linq4j"))
+    jmhImplementation("com.google.guava:guava")
+    jmhImplementation("org.codehaus.janino:commons-compiler")
+    jmhImplementation("org.openjdk.jmh:jmh-core")
+    jmhImplementation("org.openjdk.jmh:jmh-generator-annprocess")
 }
 
 // See https://github.com/melix/jmh-gradle-plugin
+// Unfortunately, current jmh-gradle-plugin does not allow to cusomize jmh parameters from the
+// command line, so the workarounds are:
+// a) Build and execute the jar itself: ./gradlew jmhJar && java -jar build/libs/calcite-...jar JMH_OPTIONS
+// b) Execute benchmarks via .main() methods from IDE (you might want to activate "power save mode"
+//    in the IDE to minimize the impact of the IDE itself on the benchmark results)
+
+tasks.withType<JavaExec>().configureEach {
+    // Execution of .main methods from IDEA should re-generate benchmark classes if required
+    dependsOn("jmhCompileGeneratedClasses")
+    doFirst {
+        // At best jmh plugin should add the generated directories to the Gradle model, however,
+        // currently it builds the jar only :-/
+        // IntelliJ IDEA "execute main method" adds a JavaExec task, so we configure it
+        classpath(File(buildDir, "jmh-generated-classes"))
+        classpath(File(buildDir, "jmh-generated-resources"))
 
 Review comment:
   Would you try creating a new test or renaming test method? Maybe you can reproduce the exception as below. 
   Sorry about the Chinese character. Literally, it means *Error: Symbol not found* 
   ```
   /Users/xu/IdeaProjects/my-calcite/ubenchmark/build/jmh-generated-sources/org/apache/calcite/benchmarks/generated/ReflectiveVisitDispatcherTest_testReflectiveVisitorDispatcherInvokeInstanceCachingUseMethodHandle_jmhTest.java:78: 错误: 找不到符号
                   blackhole.consume(l_reflectivevisitdispatchertest0_G.testReflectiveVisitorDispatcherInvokeInstanceCachingUseMethodHandle());
                                                                       ^
     符号:   方法 testReflectiveVisitorDispatcherInvokeInstanceCachingUseMethodHandle()
     位置: 类型为ReflectiveVisitDispatcherTest_jmhType的变量 l_reflectivevisitdispatchertest0_G
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA

Posted by GitBox <gi...@apache.org>.
neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA
URL: https://github.com/apache/calcite/pull/1880#discussion_r399356029
 
 

 ##########
 File path: ubenchmark/build.gradle.kts
 ##########
 @@ -22,12 +22,29 @@ dependencies {
     // Make jmhCompileClasspath resolvable
     @Suppress("DEPRECATION")
     jmhCompileClasspath(platform(project(":bom")))
-    jmh(project(":core"))
-    jmh(project(":linq4j"))
-    jmh("com.google.guava:guava")
-    jmh("org.codehaus.janino:commons-compiler")
-    jmh("org.openjdk.jmh:jmh-core")
-    jmh("org.openjdk.jmh:jmh-generator-annprocess")
+    jmhImplementation(project(":core"))
+    jmhImplementation(project(":linq4j"))
+    jmhImplementation("com.google.guava:guava")
+    jmhImplementation("org.codehaus.janino:commons-compiler")
+    jmhImplementation("org.openjdk.jmh:jmh-core")
+    jmhImplementation("org.openjdk.jmh:jmh-generator-annprocess")
 }
 
 // See https://github.com/melix/jmh-gradle-plugin
+// Unfortunately, current jmh-gradle-plugin does not allow to cusomize jmh parameters from the
+// command line, so the workarounds are:
+// a) Build and execute the jar itself: ./gradlew jmhJar && java -jar build/libs/calcite-...jar JMH_OPTIONS
+// b) Execute benchmarks via .main() methods from IDE (you might want to activate "power save mode"
+//    in the IDE to minimize the impact of the IDE itself on the benchmark results)
+
+tasks.withType<JavaExec>().configureEach {
+    // Execution of .main methods from IDEA should re-generate benchmark classes if required
+    dependsOn("jmhCompileGeneratedClasses")
+    doFirst {
+        // At best jmh plugin should add the generated directories to the Gradle model, however,
+        // currently it builds the jar only :-/
+        // IntelliJ IDEA "execute main method" adds a JavaExec task, so we configure it
+        classpath(File(buildDir, "jmh-generated-classes"))
+        classpath(File(buildDir, "jmh-generated-resources"))
 
 Review comment:
   I merge the update to my local branch, I am afraid we should add one more to make it work.
   ```
   classpath(File(buildDir, "jmh-generated-sources"))
   ``` 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] vlsi commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA

Posted by GitBox <gi...@apache.org>.
vlsi commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA
URL: https://github.com/apache/calcite/pull/1880#discussion_r399357030
 
 

 ##########
 File path: ubenchmark/build.gradle.kts
 ##########
 @@ -22,12 +22,29 @@ dependencies {
     // Make jmhCompileClasspath resolvable
     @Suppress("DEPRECATION")
     jmhCompileClasspath(platform(project(":bom")))
-    jmh(project(":core"))
-    jmh(project(":linq4j"))
-    jmh("com.google.guava:guava")
-    jmh("org.codehaus.janino:commons-compiler")
-    jmh("org.openjdk.jmh:jmh-core")
-    jmh("org.openjdk.jmh:jmh-generator-annprocess")
+    jmhImplementation(project(":core"))
+    jmhImplementation(project(":linq4j"))
+    jmhImplementation("com.google.guava:guava")
+    jmhImplementation("org.codehaus.janino:commons-compiler")
+    jmhImplementation("org.openjdk.jmh:jmh-core")
+    jmhImplementation("org.openjdk.jmh:jmh-generator-annprocess")
 }
 
 // See https://github.com/melix/jmh-gradle-plugin
+// Unfortunately, current jmh-gradle-plugin does not allow to cusomize jmh parameters from the
+// command line, so the workarounds are:
+// a) Build and execute the jar itself: ./gradlew jmhJar && java -jar build/libs/calcite-...jar JMH_OPTIONS
+// b) Execute benchmarks via .main() methods from IDE (you might want to activate "power save mode"
+//    in the IDE to minimize the impact of the IDE itself on the benchmark results)
+
+tasks.withType<JavaExec>().configureEach {
+    // Execution of .main methods from IDEA should re-generate benchmark classes if required
+    dependsOn("jmhCompileGeneratedClasses")
+    doFirst {
+        // At best jmh plugin should add the generated directories to the Gradle model, however,
+        // currently it builds the jar only :-/
+        // IntelliJ IDEA "execute main method" adds a JavaExec task, so we configure it
+        classpath(File(buildDir, "jmh-generated-classes"))
+        classpath(File(buildDir, "jmh-generated-resources"))
 
 Review comment:
   Why is that?
   What is the error message otherwise?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA

Posted by GitBox <gi...@apache.org>.
neoremind commented on a change in pull request #1880: Make ubenchmark clases executable from IDEA
URL: https://github.com/apache/calcite/pull/1880#discussion_r399633618
 
 

 ##########
 File path: ubenchmark/build.gradle.kts
 ##########
 @@ -22,12 +22,29 @@ dependencies {
     // Make jmhCompileClasspath resolvable
     @Suppress("DEPRECATION")
     jmhCompileClasspath(platform(project(":bom")))
-    jmh(project(":core"))
-    jmh(project(":linq4j"))
-    jmh("com.google.guava:guava")
-    jmh("org.codehaus.janino:commons-compiler")
-    jmh("org.openjdk.jmh:jmh-core")
-    jmh("org.openjdk.jmh:jmh-generator-annprocess")
+    jmhImplementation(project(":core"))
+    jmhImplementation(project(":linq4j"))
+    jmhImplementation("com.google.guava:guava")
+    jmhImplementation("org.codehaus.janino:commons-compiler")
+    jmhImplementation("org.openjdk.jmh:jmh-core")
+    jmhImplementation("org.openjdk.jmh:jmh-generator-annprocess")
 }
 
 // See https://github.com/melix/jmh-gradle-plugin
+// Unfortunately, current jmh-gradle-plugin does not allow to cusomize jmh parameters from the
+// command line, so the workarounds are:
+// a) Build and execute the jar itself: ./gradlew jmhJar && java -jar build/libs/calcite-...jar JMH_OPTIONS
+// b) Execute benchmarks via .main() methods from IDE (you might want to activate "power save mode"
+//    in the IDE to minimize the impact of the IDE itself on the benchmark results)
+
+tasks.withType<JavaExec>().configureEach {
+    // Execution of .main methods from IDEA should re-generate benchmark classes if required
+    dependsOn("jmhCompileGeneratedClasses")
+    doFirst {
+        // At best jmh plugin should add the generated directories to the Gradle model, however,
+        // currently it builds the jar only :-/
+        // IntelliJ IDEA "execute main method" adds a JavaExec task, so we configure it
+        classpath(File(buildDir, "jmh-generated-classes"))
+        classpath(File(buildDir, "jmh-generated-resources"))
 
 Review comment:
   @vlsi I might mislead you, maybe that is my env problem. No rush to look into this, unless any one else come into this trouble again.
   My idea version is the latest community one.
   ```
   IntelliJ IDEA 2019.3.3 (Community Edition)
   Build #IC-193.6494.35, built on February 11, 2020
   Runtime version: 11.0.5+10-b520.38 x86_64
   VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
   macOS 10.12.6
   GC: ParNew, ConcurrentMarkSweep
   Memory: 1981M
   Cores: 8
   Registry: 
   Non-Bundled Plugins: CheckStyle-IDEA, FindBugs-IDEA, Lombook Plugin, OdpsStudio, com.alibaba.p3c.smartfox, com.poratu.idea.plugins.tomcat, org.intellij.scala
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services