click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bck...@apache.org
Subject svn commit: r961483 - in /click/trunk/click/framework/test/org/apache/click/control: AttributeTest.java FormTest.java
Date Wed, 07 Jul 2010 19:25:51 GMT
Author: bckfnn
Date: Wed Jul  7 19:25:51 2010
New Revision: 961483

URL: http://svn.apache.org/viewvc?rev=961483&view=rev
Log:
get loop count from system property "click.perf.loops". CLK-708

Modified:
    click/trunk/click/framework/test/org/apache/click/control/AttributeTest.java
    click/trunk/click/framework/test/org/apache/click/control/FormTest.java

Modified: click/trunk/click/framework/test/org/apache/click/control/AttributeTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/control/AttributeTest.java?rev=961483&r1=961482&r2=961483&view=diff
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/control/AttributeTest.java (original)
+++ click/trunk/click/framework/test/org/apache/click/control/AttributeTest.java Wed Jul 
7 19:25:51 2010
@@ -137,9 +137,11 @@ public class AttributeTest extends TestC
         long start = System.currentTimeMillis();
         TextField nameField = null;
         
+        int loops = Integer.getInteger("click.perf.loops", 100000);
+        
         //100000 iterations ran in
         //    1890ms for setStyle
-        for (int i = 0; i < 100000; i++) {
+        for (int i = 0; i < loops; i++) {
             nameField = new TextField("nameFld");
             nameField.setStyle("size", "3em");//add size
             nameField.setStyle("color", "red");//add color
@@ -153,7 +155,7 @@ public class AttributeTest extends TestC
         //100000 iterations ran in
         //  906ms for setAttribute
         start = System.currentTimeMillis();
-        for (int i = 0; i < 100000; i++) {
+        for (int i = 0; i < loops; i++) {
             nameField = new TextField("nameFld");
             nameField.setAttribute("style", "size:3em");//add size
             nameField.setAttribute("style", "size:3em;color:red;");//add color
@@ -168,7 +170,7 @@ public class AttributeTest extends TestC
         //100000 iterations ran in
         //  1704ms for setStyle and getStyle
         start = System.currentTimeMillis();
-        for (int i = 0; i < 100000; i++) {
+        for (int i = 0; i < loops; i++) {
             nameField = new TextField("nameFld");
             nameField.setStyle("size", "3em");//add size
             nameField.setStyle("color", "red");//add color
@@ -183,7 +185,7 @@ public class AttributeTest extends TestC
         //100000 iterations ran in
         //  828ms for setAttribute and getAttribute
         start = System.currentTimeMillis();
-        for (int i = 0; i < 100000; i++) {
+        for (int i = 0; i < loops; i++) {
             nameField = new TextField("nameFld");
             nameField.setAttribute("style", "size:3em");//add size
             nameField.getAttribute("style");//get style
@@ -300,9 +302,11 @@ public class AttributeTest extends TestC
         long start = System.currentTimeMillis();
         TextField nameField = null;
 
+        int loops = Integer.getInteger("click.perf.loops", 100000);
+        
         //100000 iterations ran in
         //  1953ms for addStyleClass and removeStyleClass
-        for (int i = 0; i < 100000; i++) {
+        for (int i = 0; i < loops; i++) {
             nameField = new TextField("nameFld");
             nameField.addStyleClass("hidden");
             nameField.addStyleClass("display-all");
@@ -316,7 +320,7 @@ public class AttributeTest extends TestC
         //100000 iterations ran in
         //  1203ms for setAttribute and getAttribute
         start = System.currentTimeMillis();
-        for (int i = 0; i < 100000; i++) {
+        for (int i = 0; i < loops; i++) {
             nameField = new TextField("nameFld");
             nameField.setAttribute("class", "hidden");
             nameField.setAttribute("class", "hidden display-all");

Modified: click/trunk/click/framework/test/org/apache/click/control/FormTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/control/FormTest.java?rev=961483&r1=961482&r2=961483&view=diff
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/control/FormTest.java (original)
+++ click/trunk/click/framework/test/org/apache/click/control/FormTest.java Wed Jul  7 19:25:51
2010
@@ -697,7 +697,7 @@ public class FormTest extends TestCase {
         int textFieldCount = 15;
         
         // Number of times to populate a form with fields
-        int loops = 100000;
+        int loops = Integer.getInteger("click.perf.loops", 100000);
         
         long time = 0;
         for (int i = 0; i < loops; i++) {



Mime
View raw message