You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2024/09/04 11:25:49 UTC

(tomcat) branch 10.1.x updated (f902edf085 -> 24e259f580)

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

markt pushed a change to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


    from f902edf085 Fix BZ 69302 Client reset should trigger ReadListener.onError ...
     new 363b1a8cde Try and make test more reliable when running with other tests
     new 2a0c9f0288 Add instructions to edit via POPEditor.com to all translated files
     new 24e259f580 Link to Tomcat site for translation editing instructions

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/tomcat/buildutil/translate/Import.java |  1 +
 java/org/apache/tomcat/buildutil/translate/Utils.java |  9 +++++++++
 .../catalina/util/TestParameterMapPerformance.java    | 19 ++++++++++---------
 3 files changed, 20 insertions(+), 9 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


(tomcat) 01/03: Try and make test more reliable when running with other tests

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 363b1a8cdefc909abcaf310236383661d58e6d8c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Sep 3 18:46:28 2024 +0100

    Try and make test more reliable when running with other tests
    
    When run on its own, the optimised code is consistently faster.
---
 .../catalina/util/TestParameterMapPerformance.java    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/test/org/apache/catalina/util/TestParameterMapPerformance.java b/test/org/apache/catalina/util/TestParameterMapPerformance.java
index a9bf7e9f34..fe2ea9bf79 100644
--- a/test/org/apache/catalina/util/TestParameterMapPerformance.java
+++ b/test/org/apache/catalina/util/TestParameterMapPerformance.java
@@ -26,8 +26,9 @@ import org.junit.Test;
 
 public class TestParameterMapPerformance {
 
-    private final int numTests = 5;
-    private final int numTestIterations = 1000000;
+    private static final int NUM_TESTS = 10;
+    private static final int NUM_SKIP = 4;
+    private static final int NUM_TEST_ITERATIONS = 1000000;
 
     private ParameterMap<Integer,Object> baseParams;
     private ParameterMap<Integer,Object> testParams;
@@ -44,16 +45,16 @@ public class TestParameterMapPerformance {
         baseParams.setLocked(true);
 
         // warmup
-        for (int i = 0; i < numTestIterations; i++) {
+        for (int i = 0; i < NUM_TEST_ITERATIONS; i++) {
             useStandardConstructor();
             useOptimizedMapConstructor();
         }
 
         List<Long> standardDurations = new ArrayList<>();
-        for (int i = 0; i < numTests; i++) {
+        for (int i = 0; i < NUM_TESTS; i++) {
             System.gc();
             long startStandard = System.currentTimeMillis();
-            for (int j = 0; j < numTestIterations; j++) {
+            for (int j = 0; j < NUM_TEST_ITERATIONS; j++) {
                 useStandardConstructor();
             }
             long duration = System.currentTimeMillis() - startStandard;
@@ -64,13 +65,13 @@ public class TestParameterMapPerformance {
          * The CI systems tend to produce outliers that lead to false failures so skip the longest two runs.
          */
         long standardTotalDuration =
-                standardDurations.stream().sorted().limit(numTests - 2).reduce(Long::sum).get().longValue();
+                standardDurations.stream().sorted().limit(NUM_TESTS - 2).reduce(Long::sum).get().longValue();
 
         List<Long> optimizedDurations = new ArrayList<>();
-        for (int i = 0; i < numTests; i++) {
+        for (int i = 0; i < NUM_TESTS; i++) {
             System.gc();
             long startOptimized = System.currentTimeMillis();
-            for (int j = 0; j < numTestIterations; j++) {
+            for (int j = 0; j < NUM_TEST_ITERATIONS; j++) {
                 useOptimizedMapConstructor();
             }
             long duration = System.currentTimeMillis() - startOptimized;
@@ -81,7 +82,7 @@ public class TestParameterMapPerformance {
          * The CI systems tend to produce outliers that lead to false failures so skip the longest two runs.
          */
         long optimizedTotalDuration =
-                optimizedDurations.stream().sorted().limit(numTests - 2).reduce(Long::sum).get().longValue();
+                optimizedDurations.stream().sorted().limit(NUM_TESTS - NUM_SKIP).reduce(Long::sum).get().longValue();
 
         Assert.assertTrue("Standard: " + standardTotalDuration + "ms, Optimized: " + optimizedTotalDuration + "ms",
                 optimizedTotalDuration < standardTotalDuration);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


(tomcat) 02/03: Add instructions to edit via POPEditor.com to all translated files

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2a0c9f0288aaf18d6f9c6f6d5fef2c73be82fc5e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Sep 3 17:08:09 2024 +0100

    Add instructions to edit via POPEditor.com to all translated files
---
 java/org/apache/tomcat/buildutil/translate/Import.java |  1 +
 java/org/apache/tomcat/buildutil/translate/Utils.java  | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/java/org/apache/tomcat/buildutil/translate/Import.java b/java/org/apache/tomcat/buildutil/translate/Import.java
index 1ccd1fb253..888d141496 100644
--- a/java/org/apache/tomcat/buildutil/translate/Import.java
+++ b/java/org/apache/tomcat/buildutil/translate/Import.java
@@ -72,6 +72,7 @@ public class Import {
                 FileOutputStream fos = new FileOutputStream(outFile);
                 w = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
                 org.apache.tomcat.buildutil.Utils.insertLicense(w);
+                Utils.insertEditInstructions(w);
             }
 
             if (!currentGroup.equals(cKey.group)) {
diff --git a/java/org/apache/tomcat/buildutil/translate/Utils.java b/java/org/apache/tomcat/buildutil/translate/Utils.java
index 91b896f9ec..24be38e937 100644
--- a/java/org/apache/tomcat/buildutil/translate/Utils.java
+++ b/java/org/apache/tomcat/buildutil/translate/Utils.java
@@ -201,4 +201,15 @@ public class Utils {
             ioe.printStackTrace();
         }
     }
+
+
+    static void insertEditInstructions(Writer w) throws IOException {
+        w.write(System.lineSeparator());
+        w.write("# Do not edit this file directly. Translations are managed via poeditor.");
+        w.write(System.lineSeparator());
+        w.write("# Join to edit translations: https://poeditor.com/join/project/NUTIjDWzrl");
+        w.write(System.lineSeparator());
+        w.write("# View the translations    : https://poeditor.com/projects/view?id=221603");
+        w.write(System.lineSeparator());
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


(tomcat) 03/03: Link to Tomcat site for translation editing instructions

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 24e259f580ee882ca592b9d558494091bb2cd2b3
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 4 11:16:18 2024 +0100

    Link to Tomcat site for translation editing instructions
---
 java/org/apache/tomcat/buildutil/translate/Utils.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/buildutil/translate/Utils.java b/java/org/apache/tomcat/buildutil/translate/Utils.java
index 24be38e937..e29ddbf7df 100644
--- a/java/org/apache/tomcat/buildutil/translate/Utils.java
+++ b/java/org/apache/tomcat/buildutil/translate/Utils.java
@@ -205,11 +205,9 @@ public class Utils {
 
     static void insertEditInstructions(Writer w) throws IOException {
         w.write(System.lineSeparator());
-        w.write("# Do not edit this file directly. Translations are managed via poeditor.");
+        w.write("# Do not edit this file directly.");
         w.write(System.lineSeparator());
-        w.write("# Join to edit translations: https://poeditor.com/join/project/NUTIjDWzrl");
-        w.write(System.lineSeparator());
-        w.write("# View the translations    : https://poeditor.com/projects/view?id=221603");
+        w.write("# To edit transaltions see: https://tomcat.apache.org/getinvolved.html#Translations");
         w.write(System.lineSeparator());
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org