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 2021/01/22 17:52:24 UTC

[tomcat] branch 9.0.x updated: Comment out / make configurable the performance aspects of these tests

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new e12eb8e  Comment out / make configurable the performance aspects of these tests
e12eb8e is described below

commit e12eb8ec2305db71389db6a94fcf2f9a0317b8fd
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Jan 22 17:51:48 2021 +0000

    Comment out / make configurable the performance aspects of these tests
---
 .../optimizations/TestELInterpreterTagSetters.java      | 17 +++++++++++------
 test/webapp/bug6nnnn/bug64872-bigdecimal.jsp            |  2 +-
 test/webapp/bug6nnnn/bug64872-biginteger.jsp            |  2 +-
 test/webapp/bug6nnnn/bug64872-boolean.jsp               |  2 +-
 test/webapp/bug6nnnn/bug64872-byte.jsp                  |  2 +-
 test/webapp/bug6nnnn/bug64872-character.jsp             |  2 +-
 test/webapp/bug6nnnn/bug64872-double.jsp                |  2 +-
 test/webapp/bug6nnnn/bug64872-float.jsp                 |  2 +-
 test/webapp/bug6nnnn/bug64872-integer.jsp               |  2 +-
 test/webapp/bug6nnnn/bug64872-long.jsp                  |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-boolean.jsp     |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-byte.jsp        |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-character.jsp   |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-double.jsp      |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-float.jsp       |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-integer.jsp     |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-long.jsp        |  2 +-
 test/webapp/bug6nnnn/bug64872-primitive-short.jsp       |  2 +-
 test/webapp/bug6nnnn/bug64872-short.jsp                 |  2 +-
 test/webapp/bug6nnnn/bug64872-string.jsp                |  2 +-
 test/webapp/bug6nnnn/bug64872-timeunit.jsp              |  2 +-
 21 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/test/org/apache/jasper/optimizations/TestELInterpreterTagSetters.java b/test/org/apache/jasper/optimizations/TestELInterpreterTagSetters.java
index ac66ddd..05b1a4f 100644
--- a/test/org/apache/jasper/optimizations/TestELInterpreterTagSetters.java
+++ b/test/org/apache/jasper/optimizations/TestELInterpreterTagSetters.java
@@ -55,14 +55,15 @@ public class TestELInterpreterTagSetters extends TomcatBaseTest {
         List<Object[]> parameterSets = new ArrayList<>();
 
         ELInterpreter[] elInterpreters = new ELInterpreter[] {
-                // Warm-up
                 // First call will trigger compilation (and therefore be slower)
-                // Call both to ensure both are warmed up
-                new ELInterpreterWrapper(true, "TagSetters"),
-                new ELInterpreterWrapper(false, "Default"),
-                // Compare times of these test runs
+                // For performance tests call each once to warm-up and once to
+                // test
                 new ELInterpreterWrapper(true, "TagSetters"),
                 new ELInterpreterWrapper(false, "Default"),
+                // Uncomment for a performance test and compare times of these
+                // test runs
+                //new ELInterpreterWrapper(true, "TagSetters"),
+                //new ELInterpreterWrapper(false, "Default"),
                 };
 
         for (ELInterpreter elInterpreter : elInterpreters) {
@@ -115,7 +116,11 @@ public class TestELInterpreterTagSetters extends TomcatBaseTest {
 
         ctxt.getServletContext().setAttribute(StringInterpreter.class.getCanonicalName(), new StringInterpreterEnum());
 
-        ByteChunk bc = getUrl("http://localhost:" + getPort() + "/test/bug6nnnn/bug64872-" + target + ".jsp");
+        // Change this to 1000000 to test performance
+        String iterations = "1";
+
+        ByteChunk bc = getUrl("http://localhost:" + getPort() +
+                "/test/bug6nnnn/bug64872-" + target + ".jsp?iterations=" + iterations);
 
         String actual = bc.toString();
 
diff --git a/test/webapp/bug6nnnn/bug64872-bigdecimal.jsp b/test/webapp/bug6nnnn/bug64872-bigdecimal.jsp
index 9bd18ed..9279a04 100644
--- a/test/webapp/bug6nnnn/bug64872-bigdecimal.jsp
+++ b/test/webapp/bug6nnnn/bug64872-bigdecimal.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 BigDecimal test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagBigDecimal foo="${'12.34'}" />]</p>
     <p>02 The value of foo is [<ts:tagBigDecimal foo='${"12.34"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-biginteger.jsp b/test/webapp/bug6nnnn/bug64872-biginteger.jsp
index 0fcd1c6..a81d995 100644
--- a/test/webapp/bug6nnnn/bug64872-biginteger.jsp
+++ b/test/webapp/bug6nnnn/bug64872-biginteger.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 BigInteger test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagBigInteger foo="${'1234'}" />]</p>
     <p>02 The value of foo is [<ts:tagBigInteger foo='${"1234"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-boolean.jsp b/test/webapp/bug6nnnn/bug64872-boolean.jsp
index 7bdc126..fed123c 100644
--- a/test/webapp/bug6nnnn/bug64872-boolean.jsp
+++ b/test/webapp/bug6nnnn/bug64872-boolean.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Boolean.TRUE test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagBoolean foo="${false}" />]</p>
     <p>02 The value of foo is [<ts:tagBoolean foo="${'false'}" />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-byte.jsp b/test/webapp/bug6nnnn/bug64872-byte.jsp
index 8696a0a..e8684dd 100644
--- a/test/webapp/bug6nnnn/bug64872-byte.jsp
+++ b/test/webapp/bug6nnnn/bug64872-byte.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Byte test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagByte foo="${'12'}" />]</p>
     <p>02 The value of foo is [<ts:tagByte foo='${"12"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-character.jsp b/test/webapp/bug6nnnn/bug64872-character.jsp
index 0f6ec23..1821399 100644
--- a/test/webapp/bug6nnnn/bug64872-character.jsp
+++ b/test/webapp/bug6nnnn/bug64872-character.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Character test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagCharacter foo="${'bar'}" />]</p>
     <p>02 The value of foo is [<ts:tagCharacter foo='${"bar"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-double.jsp b/test/webapp/bug6nnnn/bug64872-double.jsp
index 799a0c0..3d5d32d 100644
--- a/test/webapp/bug6nnnn/bug64872-double.jsp
+++ b/test/webapp/bug6nnnn/bug64872-double.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Double test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagDouble foo="${'12.34'}" />]</p>
     <p>02 The value of foo is [<ts:tagDouble foo='${"12.34"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-float.jsp b/test/webapp/bug6nnnn/bug64872-float.jsp
index 19d6226..6f70dcf 100644
--- a/test/webapp/bug6nnnn/bug64872-float.jsp
+++ b/test/webapp/bug6nnnn/bug64872-float.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Float test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagFloat foo="${'12.34'}" />]</p>
     <p>02 The value of foo is [<ts:tagFloat foo='${"12.34"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-integer.jsp b/test/webapp/bug6nnnn/bug64872-integer.jsp
index 255d716..b19ca58 100644
--- a/test/webapp/bug6nnnn/bug64872-integer.jsp
+++ b/test/webapp/bug6nnnn/bug64872-integer.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Integer test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagInteger foo="${'1234'}" />]</p>
     <p>02 The value of foo is [<ts:tagInteger foo='${"1234"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-long.jsp b/test/webapp/bug6nnnn/bug64872-long.jsp
index 2b7b4c8..6ad9407 100644
--- a/test/webapp/bug6nnnn/bug64872-long.jsp
+++ b/test/webapp/bug6nnnn/bug64872-long.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Long test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagLong foo="${'1234'}" />]</p>
     <p>02 The value of foo is [<ts:tagLong foo='${"1234"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-boolean.jsp b/test/webapp/bug6nnnn/bug64872-primitive-boolean.jsp
index 1f0073a..2fee98f 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-boolean.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-boolean.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 boolean false test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveBoolean foo="${false}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveBoolean foo="${'false'}" />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-byte.jsp b/test/webapp/bug6nnnn/bug64872-primitive-byte.jsp
index aed0705..3507773 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-byte.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-byte.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 byte test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveByte foo="${'12'}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveByte foo='${"12"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-character.jsp b/test/webapp/bug6nnnn/bug64872-primitive-character.jsp
index 03762a6..4d74290 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-character.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-character.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 char test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveCharacter foo="${'bar'}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveCharacter foo='${"bar"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-double.jsp b/test/webapp/bug6nnnn/bug64872-primitive-double.jsp
index b1cd64b..ad83637 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-double.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-double.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 double test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveDouble foo="${'12.34'}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveDouble foo='${"12.34"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-float.jsp b/test/webapp/bug6nnnn/bug64872-primitive-float.jsp
index c574a845..f46ff67 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-float.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-float.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 float test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveFloat foo="${'12.34'}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveFloat foo='${"12.34"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-integer.jsp b/test/webapp/bug6nnnn/bug64872-primitive-integer.jsp
index 059f217..091f8b0 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-integer.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-integer.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 int test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveInteger foo="${'1234'}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveInteger foo='${"1234"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-long.jsp b/test/webapp/bug6nnnn/bug64872-primitive-long.jsp
index bf900f2..b5861b3 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-long.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-long.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 long test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveLong foo="${'1234'}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveLong foo='${"1234"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-primitive-short.jsp b/test/webapp/bug6nnnn/bug64872-primitive-short.jsp
index 275ca58..96f2c54 100644
--- a/test/webapp/bug6nnnn/bug64872-primitive-short.jsp
+++ b/test/webapp/bug6nnnn/bug64872-primitive-short.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 short test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagPrimitiveShort foo="${'1234'}" />]</p>
     <p>02 The value of foo is [<ts:tagPrimitiveShort foo='${"1234"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-short.jsp b/test/webapp/bug6nnnn/bug64872-short.jsp
index cd4e19e..98a3d39 100644
--- a/test/webapp/bug6nnnn/bug64872-short.jsp
+++ b/test/webapp/bug6nnnn/bug64872-short.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 Short test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagShort foo="${'1234'}" />]</p>
     <p>02 The value of foo is [<ts:tagShort foo='${"1234"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-string.jsp b/test/webapp/bug6nnnn/bug64872-string.jsp
index 4dfa711..658d4b0 100644
--- a/test/webapp/bug6nnnn/bug64872-string.jsp
+++ b/test/webapp/bug6nnnn/bug64872-string.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 String test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagString foo="${'bar'}" />]</p>
     <p>02 The value of foo is [<ts:tagString foo='${"bar"}' />]</p>
diff --git a/test/webapp/bug6nnnn/bug64872-timeunit.jsp b/test/webapp/bug6nnnn/bug64872-timeunit.jsp
index 00b71ba..1f0fb33 100644
--- a/test/webapp/bug6nnnn/bug64872-timeunit.jsp
+++ b/test/webapp/bug6nnnn/bug64872-timeunit.jsp
@@ -19,7 +19,7 @@
   <head><title>Bug 64872 TimeUnit test case</title></head>
   <body>
   <%
-  for (int i=0; i < 1000000; i++) {
+  for (int i=0; i < Integer.parseInt(request.getParameter("iterations")); i++) {
   %>
     <p>01 The value of foo is [<ts:tagTimeUnit foo="${'SECONDS'}" />]</p>
     <p>02 The value of foo is [<ts:tagTimeUnit foo='${"SECONDS"}' />]</p>


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