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 2024/09/11 11:49:43 UTC

(groovy) branch master updated: prettier output formatting

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 29f5a1eb0c prettier output formatting
29f5a1eb0c is described below

commit 29f5a1eb0c174514a56e94892d07f417adbad45f
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Sep 11 21:45:30 2024 +1000

    prettier output formatting
---
 .../groovy/org/apache/groovy/gradle/PerformanceTestSummary.groovy    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestSummary.groovy b/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestSummary.groovy
index a123a86b53..f1d7302dfe 100644
--- a/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestSummary.groovy
+++ b/build-logic/src/main/groovy/org/apache/groovy/gradle/PerformanceTestSummary.groovy
@@ -48,11 +48,12 @@ class PerformanceTestSummary extends DefaultTask {
 
         versions = versions.sort { ((List) it)[1] }
         def fastest = ((List) versions[0])[1]
+        def df = new DecimalFormat("#.##")
         versions.each { version, mean, stdDev ->
-            print "Groovy $version Average ${mean}ms ± ${new DecimalFormat("#.##").format(stdDev)}ms "
+            print "Groovy ${sprintf '%-20s', version} Average ${df.format(mean)}ms ± ${df.format(stdDev)}ms "
             if (mean > fastest) {
                 def diff = 100 * (mean - fastest) / fastest
-                print "(${new DecimalFormat("#.##").format(diff)}% slower)"
+                print "(${df.format(diff)}% slower)"
             }
             println()
         }