You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/11/15 02:28:20 UTC

[groovy] 01/08: fix `performance:performanceTests` including updating dependencies and remove dependency verification metadata for its dependencies (currently repeated for each Groovy version in the test)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit d66cc9daa1dfea6bca6216f639a85e72473589ac
Author: Paul King <pa...@asert.com.au>
AuthorDate: Fri Nov 11 22:23:51 2022 +1000

    fix `performance:performanceTests` including updating dependencies and remove dependency verification metadata for its dependencies (currently repeated for each Groovy version in the test)
---
 .../groovy/org.apache.groovy-performance.gradle    |  7 +++++++
 .../groovy/gradle/PerformanceTestsExtension.groovy |  7 +++++--
 subprojects/performance/build.gradle               |  7 +++----
 .../groovy/perf/CompilerPerformanceTest.java       | 24 +++++++++++-----------
 4 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/build-logic/src/main/groovy/org.apache.groovy-performance.gradle b/build-logic/src/main/groovy/org.apache.groovy-performance.gradle
index 271217b9a4..fa5f5bb6ab 100644
--- a/build-logic/src/main/groovy/org.apache.groovy-performance.gradle
+++ b/build-logic/src/main/groovy/org.apache.groovy-performance.gradle
@@ -34,6 +34,13 @@ configurations {
     testImplementation.extendsFrom(stats)
 }
 
+repositories {
+    mavenCentral()
+    maven {
+        url 'https://repository.ow2.org/nexus/content/repositories/public/'
+    }
+}
+
 dependencies {
     jmh project(":")
     testImplementation project(":")
diff --git a/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestsExtension.groovy b/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestsExtension.groovy
index 8d4835af21..365c68ce86 100644
--- a/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestsExtension.groovy
+++ b/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestsExtension.groovy
@@ -76,6 +76,9 @@ class PerformanceTestsExtension {
         def groovyConf = configurations.create("groovyVersion$version") { Configuration it ->
             it.canBeResolved = true
             it.canBeConsumed = false
+            it.resolutionStrategy {
+                disableDependencyVerification()
+            }
             it.extendsFrom(configurations.getByName("stats"))
             it.attributes {
                 it.attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.LIBRARY))
@@ -99,9 +102,9 @@ class PerformanceTestsExtension {
             it.dependencies.add(dependencies.create('commons-httpclient:commons-httpclient:3.1'))
             it.dependencies.add(dependencies.create('net.sf.jopt-simple:jopt-simple:5.0.4'))
             it.dependencies.add(dependencies.create('com.baulsupp.kolja:jcurses:0.9.5.3'))
-            it.dependencies.add(dependencies.create('mstor:mstor:0.9.9'))
+            it.dependencies.add(dependencies.create('org.mnode.mstor:mstor:1.0.2'))
             it.dependencies.add(dependencies.create('commons-lang:commons-lang:2.6'))
-            it.dependencies.add(dependencies.create('dnsjava:dnsjava:2.1.9'))
+            it.dependencies.add(dependencies.create('dnsjava:dnsjava:3.5.1'))
             it.dependencies.add(dependencies.create('net.sourceforge.expectj:expectj:2.0.7'))
             it.dependencies.add(dependencies.create('jline:jline:2.14.6'))
             it.dependencies.add(dependencies.create('prevayler:prevayler:2.02.005'))
diff --git a/subprojects/performance/build.gradle b/subprojects/performance/build.gradle
index 06d63c54bb..9bdb3c9a3a 100644
--- a/subprojects/performance/build.gradle
+++ b/subprojects/performance/build.gradle
@@ -21,10 +21,9 @@ plugins {
 }
 
 performanceTests {
-    versions '2.4.21',
-            '2.5.18',
-            '3.0.12',
-            '4.0.4',
+    versions '2.5.19',
+            '3.0.13',
+            '4.0.6',
             'current'
 
     testFiles project.files("src/files") +
diff --git a/subprojects/performance/src/test/java/org/apache/groovy/perf/CompilerPerformanceTest.java b/subprojects/performance/src/test/java/org/apache/groovy/perf/CompilerPerformanceTest.java
index 4f5a5b7cfd..e4383be4a1 100644
--- a/subprojects/performance/src/test/java/org/apache/groovy/perf/CompilerPerformanceTest.java
+++ b/subprojects/performance/src/test/java/org/apache/groovy/perf/CompilerPerformanceTest.java
@@ -30,8 +30,8 @@ import java.util.List;
 
 public class CompilerPerformanceTest {
     private final static String GROOVY_VERSION = GroovySystem.getVersion();
-    private final static int WARMUP = 200;
-    private final static int REPEAT = 1000;
+    private final static int WARMUP = 100;
+    private final static int REPEAT = 500;
 
     public static void main(String[] args) throws Exception {
         List<File> sources = new ArrayList<>();
@@ -53,30 +53,30 @@ public class CompilerPerformanceTest {
             }
         }
         ScriptCompilationExecuter executer = new ScriptCompilationExecuter(
-                sources.toArray(new File[sources.size()]),
-                classpath
+            sources.toArray(new File[sources.size()]),
+            classpath
         );
-        System.out.println("Using Groovy " + GROOVY_VERSION);
+        System.out.println("Showing compile times for Groovy " + GROOVY_VERSION);
 
         DescriptiveStatistics stats = new DescriptiveStatistics();
 
-        for (int i=0;i<WARMUP+REPEAT;i++) {
-            if (i%10 == 0) {
+        for (int i = 0; i < WARMUP + REPEAT; i++) {
+            if (i % 10 == 0) {
                 if (i < WARMUP) {
-                    System.out.println("Warmup #" + (i + 1));
+                    System.out.println("\nWarmup #" + (i + 1));
                 } else {
-                    System.out.println("Round #" + (i - WARMUP));
+                    System.out.println("\nRound # " + (i - WARMUP));
                 }
             }
             long dur = executer.execute();
             System.gc();
-            System.out.printf("Compile time = %dms%n", dur);
-            if (i>=WARMUP) {
+            System.out.printf("%dms ", dur);
+            if (i >= WARMUP) {
                 stats.addValue((double) dur);
             }
         }
 
-        System.out.println("Compilation took " + stats.getMean() + "ms ± " + stats.getStandardDeviation() + "ms");
+        System.out.println("\nCompilation took " + stats.getMean() + "ms ± " + stats.getStandardDeviation() + "ms");
         FileWriter wrt = new FileWriter(new File(outputFile), false);
         wrt.append(String.format("%s;%s;%s\n", GROOVY_VERSION, stats.getMean(), stats.getStandardDeviation()));
         wrt.close();