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/03/12 09:03:44 UTC

[groovy] branch GROOVY_3_0_X updated: rework broken performance subproject which hasn't been used much for a long time (port to 3_0_X)

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

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


The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
     new 955de75  rework broken performance subproject which hasn't been used much for a long time (port to 3_0_X)
955de75 is described below

commit 955de75f7aa6bbdd04d7b313f928f8d190d22b15
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Mar 12 12:51:17 2022 +1000

    rework broken performance subproject which hasn't been used much for a long time (port to 3_0_X)
---
 build.gradle                         |  1 +
 subprojects/groovy-test/build.gradle |  4 ----
 subprojects/performance/build.gradle | 42 ++++++++++++++++++++----------------
 3 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/build.gradle b/build.gradle
index 20d6de6..5d6ad3d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -141,6 +141,7 @@ ext {
     javaParserVersion = '3.24.0'
     jlineVersion = '2.14.6'
     jmockVersion = '1.2.0'
+    junitVersion = '4.13.2'
     logbackVersion = '1.2.10'
     log4jVersion = '1.2.17'
     log4j2Version = '2.17.1'
diff --git a/subprojects/groovy-test/build.gradle b/subprojects/groovy-test/build.gradle
index d70e688..86c4768 100644
--- a/subprojects/groovy-test/build.gradle
+++ b/subprojects/groovy-test/build.gradle
@@ -17,10 +17,6 @@
  *  under the License.
  */
 
-ext {
-    junitVersion = '4.13.2'
-}
-
 dependencies {
     api rootProject   // GroovyTestCase uses Closure...
     api "junit:junit:$junitVersion" // GroovyTestCase extends TestCase...
diff --git a/subprojects/performance/build.gradle b/subprojects/performance/build.gradle
index 9e9afea..18f8faf 100644
--- a/subprojects/performance/build.gradle
+++ b/subprojects/performance/build.gradle
@@ -31,6 +31,7 @@ configurations {
 dependencies {
     jmh rootProject
     testImplementation rootProject
+    testImplementation "junit:junit:$junitVersion"
     stats 'org.apache.commons:commons-math3:3.6.1'
 }
 
@@ -47,6 +48,10 @@ jmhClasses.dependsOn clean
 sourceCompatibility = 1.8
 targetCompatibility = 1.8
 
+def findProject = { name ->
+    rootProject.subprojects.find{it.name == name }
+}
+
 task performanceTests {
     ext.outputDir = file("$buildDir/compilation")
     ext.dataFile = file("$buildDir/compilation-stats.csv")
@@ -75,30 +80,31 @@ task performanceTests {
     }
 }
 
-['1.8.9', '2.0.8', '2.1.9', '2.2.2', '2.3.10', '2.3.11', '2.4.7', 'current'].each { version ->
-    def t = task "performanceTestGroovy${version.replace('.', '_')}"(type: JavaExec, dependsOn: compileTestGroovy) {
+['2.1.9', '2.2.2', '2.3.11', '2.4.21', '2.5.16', '3.0.10', 'current'].each { version ->
+    def t = task "performanceTestGroovy_${version.replace('.', '_')}"(type: JavaExec, dependsOn: compileTestGroovy) {
         def groovyConf = configurations.detachedConfiguration(
-                dependencies.create(
-                        'current' == version ? files(rootProject.jar.archivePath) : "org.codehaus.groovy:groovy:$version")
+                *('current' == version ?
+                        [rootProject, findProject('groovy-test')].collect { Project p ->
+                            dependencies.create(files(p.jar.archivePath))
+                        } + [dependencies.create("org.ow2.asm:asm:$asmVersion"), dependencies.create("antlr:antlr:$antlrVersion"), dependencies.create("com.tunnelvisionlabs:antlr4-runtime:$antlr4Version")] :
+                        version < '2.5.0' ?
+                                [dependencies.create("org.codehaus.groovy:groovy-all:$version")]
+                                :
+                                ['groovy', 'groovy-test'].collect { String p ->
+                                    dependencies.create("org.codehaus.groovy:$p:$version")
+                                })
         )
         groovyConf.transitive = false
         main = 'org.apache.groovy.perf.CompilerPerformanceTest'
         classpath = groovyConf + sourceSets.test.output + configurations.stats
-        jvmArgs = ['-Xms512m', '-Xmx512m', '-XX:MaxPermSize=512m']
+        jvmArgs = ['-Xms512m', '-Xmx512m']
 
         // configure some files to compile. This is an arbitrary set of files which can be compiled
         // independently of the version of Groovy being tested
-        def testFiles = ['gls/CompilableTestSupport.groovy',
-                         'groovy/beans',
-                         'groovy/benchmarks',
-                         'groovy/execute',
-                         'groovy/gpath',
-                         'groovy/io',
-                         'groovy/script',
-                         'groovy/time',
-                         'groovy/tree',
-                         'gls/syntax'].collect { "../../src/test/$it" }
-        ['groovy-ant', 'groovy-test', 'groovy-jsr223'].collect(testFiles) { "../../subprojects/$it/src/test/groovy" }
+        def testFiles = [
+                'org/codehaus/groovy/util',
+        ].collect { "../../src/main/groovy/$it" }
+//        ['groovy-docgenerator'].collect(testFiles) { "../../subprojects/$it/src/main/groovy" }
 
         ['ackermann', 'fibo', 'random', 'spectralnorm', 'ary', 'hello', 'recursive', 'threadring',
          'binarytrees', 'mandelbrot', 'regexdna', 'wordfreq',
@@ -109,10 +115,10 @@ task performanceTests {
         doFirst {
             def compileClassPath = [
                     '-cp',
-                    groovyConf.files[0]
+                    *groovyConf.files*.absolutePath
             ]
             rootProject.sourceSets.test.compileClasspath.files
-                    .findAll { it.name.endsWith('jar') && !it.name.contains('groovy') && !it.name.contains('antlr') && !it.name.contains('asm') }
+                    .findAll { it.name.endsWith('jar') && !it.name.contains('groovy') }
                     .collect(compileClassPath) { it.absolutePath }
 
             args = [