You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by pa...@apache.org on 2002/04/02 19:41:41 UTC
cvs commit: xml-xalan/test/java/src/org/apache/qetest/xsl PerfTestlet.java
pauldick 02/04/02 09:41:41
Modified: test/java/src/org/apache/qetest/xsl PerfTestlet.java
Log:
Minor cleanup for performance test.
Revision Changes Path
1.3 +21 -12 xml-xalan/test/java/src/org/apache/qetest/xsl/PerfTestlet.java
Index: PerfTestlet.java
===================================================================
RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/PerfTestlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PerfTestlet.java 29 Mar 2002 15:10:58 -0000 1.2
+++ PerfTestlet.java 2 Apr 2002 17:41:41 -0000 1.3
@@ -77,7 +77,7 @@
* transformWrapper will return different sets of timings.
*
* @author Shane_Curcuru@us.ibm.com
- * @version $Id: PerfTestlet.java,v 1.2 2002/03/29 15:10:58 pauldick Exp $
+ * @version $Id: PerfTestlet.java,v 1.3 2002/04/02 17:41:41 pauldick Exp $
*/
public class PerfTestlet extends StylesheetTestlet
{
@@ -114,6 +114,8 @@
// Setup: Save options from the datalet in convenience variables
int iterations = 10;
boolean runtimeGC = false;
+ long[] times = null;
+
try
{
iterations = Integer.parseInt(datalet.options.getProperty("iterations"));
@@ -126,6 +128,7 @@
catch (Exception e) { /* no-op, leave as default */ }
// Setup: store various XalanC-like timing data in convenience variables
+ long warmup = 0L; // First transform. Used to load classes.
long singletransform = 0L; // Very first Preload end-to-end transform
long etoe = 0L; // First end-to-end transform during iterations
long avgetoe = 0L; // Average of end-to-end transforms during iterations
@@ -134,17 +137,22 @@
long unparsedxml = 0L; // First stylesheet process during iterations
long avgunparsedxml = 0L;// Average of stylesheet process during iterations
- logger.logMsg(Logger.TRACEMSG, "executing with: inputName=" + datalet.inputName
- + " xmlName=" + datalet.xmlName + " outputName=" + datalet.outputName
- + " goldName=" + datalet.goldName + " flavor=" + datalet.flavor
- + " iterations=" + iterations
- + " algorithim=" + getDescription());
+ //logger.logMsg(Logger.TRACEMSG, "executing with: inputName=" + datalet.inputName
+ // + " xmlName=" + datalet.xmlName + " outputName=" + datalet.outputName
+ // + " goldName=" + datalet.goldName + " flavor=" + datalet.flavor
+ // + " iterations=" + iterations
+ // + " algorithim=" + getDescription());
//@todo make various logMemory calls optional
- logMemory(runtimeGC, true);
+ logMemory(runtimeGC, false);
+
+ // Measure(warmup): JVM warm up
+ times = transformWrapper.transform(datalet.xmlName, datalet.inputName,
+ datalet.outputName);
+ warmup = times[TransformWrapper.IDX_OVERALL];
+ logMemory(runtimeGC, false);
// Measure(singletransform): Very first Preload end-to-end transform
- long[] times = null;
times = transformWrapper.transform(datalet.xmlName, datalet.inputName,
datalet.outputName);
singletransform = times[TransformWrapper.IDX_OVERALL];
@@ -176,7 +184,7 @@
// Measure(etoe): once: first full process
times = transformWrapper.transform(datalet.xmlName, datalet.inputName, datalet.outputName);
etoe = times[TransformWrapper.IDX_OVERALL];
- logMemory(runtimeGC, true);
+ logMemory(runtimeGC, false);
// Aggregate all specific timing data returned by TransformWrappers
// note that different flavors of wrappers will be able
@@ -210,6 +218,7 @@
// inputName is the actual name we gave to the processor
attrs.put("inputName", datalet.inputName);
attrs.put("iterations", new Integer(iterations));
+ attrs.put("warmup", new Long(warmup));
attrs.put("singletransform", new Long(singletransform)); // Very first Preload end-to-end transform
attrs.put("etoe", new Long(etoe)); // First end-to-end transform during iterations
// Note that avgetoe should match logTimes()'s OVERALL value
@@ -234,14 +243,14 @@
fOutStrm.close();
// Calculate thruput as Kb/sec. This is based on DataPower code.
- double thruPut = (double)(1000 * (btIn + btOut)) / (double)(1024 * 2 * avgparsexsl);
+ double thruPut = (double)(1000 * (btIn + btOut)) / (double)(1024 * 2 * avgunparsedxml);
DecimalFormat fmt = new DecimalFormat("####.##");
StringBuffer x = new StringBuffer( fmt.format(thruPut));
attrs.put("KBs", x);
- logger.logElement(Logger.STATUSMSG, "perf", attrs, "PItr;");
-
+ //logger.logElement(Logger.STATUSMSG, "perf", attrs, "PItr;");
+ logger.logElement(Logger.STATUSMSG, "perf", attrs, fIn.getName());
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org