pauldick 00/11/16 07:20:17
Modified: c/Tests/Performance perf.dsp perf.cpp
Log:
Minor updates
Revision Changes Path
1.3 +4 -4 xml-xalan/c/Tests/Performance/perf.dsp
Index: perf.dsp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Performance/perf.dsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- perf.dsp 2000/11/08 19:09:39 1.2
+++ perf.dsp 2000/11/16 15:20:14 1.3
@@ -42,7 +42,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D
"_MBCS" /YX /FD /c
-# ADD CPP /nologo /W4 /GX /O2 /I "..\..\..\..\xml-xerces\c\src" /I
"..\..\src\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W4 /GX /O2 /I "..\..\..\..\xml-xerces\c\src" /I
"..\..\src\\" /I "..\harness\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS"
/YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -50,7 +50,7 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release\xerces-c_1.lib
..\..\Build\Win32\VC6\Release\*.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 Harness.lib
..\..\..\..\xml-xerces\c\Build\Win32\VC6\Release\xerces-c_1.lib
..\..\Build\Win32\VC6\Release\*.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
/libpath:"..\Harness\Release\\"
!ELSEIF "$(CFG)" == "perf - Win32 Debug"
@@ -66,7 +66,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D
"_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\src\\" /I
"..\..\..\..\xml-xerces\c\src\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D
"_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\src\\" /I
"..\..\..\..\xml-xerces\c\src\\" /I "..\harness\\" /D "WIN32" /D "_DEBUG" /D
"_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# SUBTRACT CPP /X
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@@ -75,7 +75,7 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
/pdbtype:sept
-# ADD LINK32 ..\..\..\..\xml-xerces\c\Build\Win32\VC6\Debug\xerces-c_1D.lib
..\..\Build\Win32\VC6\Debug\*.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug
/machine:I386 /pdbtype:sept
+# ADD LINK32 Harness.lib
..\..\..\..\xml-xerces\c\Build\Win32\VC6\Debug\xerces-c_1D.lib
..\..\Build\Win32\VC6\Debug\*.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug
/machine:I386 /pdbtype:sept /libpath:"..\Harness\Debug\\"
!ENDIF
1.3 +43 -10 xml-xalan/c/Tests/Performance/perf.cpp
Index: perf.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/Tests/Performance/perf.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- perf.cpp 2000/11/08 19:10:36 1.2
+++ perf.cpp 2000/11/16 15:20:14 1.3
@@ -67,6 +67,7 @@
#include <cstdio>
#include <ctime>
#include <string>
+#include <string.h>
#include <vector>
#include <util/PlatformUtils.hpp>
@@ -91,7 +92,9 @@
#include <XercesParserLiaison/XercesParserLiaison.hpp>
+#include <XMLFileReporter.hpp>
+
//This is here for the threads.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -116,13 +119,13 @@
#endif
-const char* const xslStylesheets[] =
+const char* xslStylesheets[] =
{
"v:\\xsl-test\\perf\\basic\\basic-all_well",
"v:\\xsl-test\\perf\\basic\\basic-datetranscode",
"v:\\xsl-test\\perf\\basic\\basic-dict2",
"v:\\xsl-test\\perf\\basic\\basic-Fischer-Euwe",
- "v:\\xsl-test\\perf\\basic\\basic-queens",
+ //"v:\\xsl-test\\perf\\basic\\basic-queens",
"v:\\xsl-test\\perf\\large\\large-all_well",
//"v:\\xsl-test\\perf\\large\\large-evans_large",
"v:\\xsl-test\\perf\\nodes\\nodes-fancy_xml_tree_viewer_34",
@@ -132,7 +135,7 @@
"v:\\xsl-test\\perf\\xpath\\xpath-evans_tiny",
0
};
-
+const char* outputDir = "d:\\xslt-results\\perf\\test\\";
// Used to hold compiled stylesheet, and source document.
@@ -146,6 +149,14 @@
int main( int argc, const char* argv [])
{
+ XMLFileReporter theXMLFileReporter;
+
+ theXMLFileReporter.setFileName("testfile.txt");
+ theXMLFileReporter.initialize();
+ theXMLFileReporter.logTestFileInit("CConformanceTest - Iterates over
all conf test dirs and validates outputs USING Xalan-C");
+ theXMLFileReporter.logTestFileClose("xxx", "pass");
+ theXMLFileReporter.close();
+
assert(sizeof(glbStylesheetRoot) == sizeof(glbSourceXML));
#if !defined(NDEBUG) && defined(_MSC_VER)
@@ -223,8 +234,17 @@
// Ask the processor to create a
compiled stylesheet (StylesheetRoot) for the
// specified input XSL. We don't have
to delete it, since it is owned by the
// StylesheetConstructionContext
instance.
+
+ {const double startTime = clock();
+ //cout << "Clock before Compliation: "
<< startTime << endl;
+
glbStylesheetRoot[i] =
csProcessor.processStylesheet(csStylesheetSourceXSL,
csConstructionContext);
+ const double endTime = clock();
+ //cout << "Clock after Compliation: "
<< endTime << endl;
+ cout << "Compliation took: " << endTime
- startTime << endl;
+ }
+
assert(glbStylesheetRoot[i] != 0);
// Have the processor create a compiled
SourceDocument for the specified
@@ -235,7 +255,7 @@
for(int ii = 0; xslStylesheets[ii] != 0; ii++)
{
- cout << endl << "Now running test: " <<
xslStylesheets[ii] << endl;
+ cout << endl << "Testing: " <<
xslStylesheets[ii] << endl;
// The execution context uses the same
factory support objects as
// the processor, since those objects
have the same lifetime as
@@ -246,15 +266,28 @@
csXPathSupport,
csXObjectFactory);
- const XalanDOMString
outputfile(XalanDOMString(xslStylesheets[ii]) + outputSuffix);
+ const XalanDOMString
outputfile(//XalanDOMString(outputDir) +
+
XalanDOMString(xslStylesheets[ii]) +
+
outputSuffix);
//Generate the XML input and output
objects.
XSLTInputSource
csSourceXML(glbSourceXML[ii]);
XSLTResultTarget
theResultTarget(outputfile);
// Set the stylesheet to be the
compiled stylesheet. Then do the transform.
+ const double singleStart = clock();
+ //cout << "Clock before single
transform: " << singleStart << endl;
+
csProcessor.setStylesheetRoot(glbStylesheetRoot[ii]);
+
csProcessor.process(csSourceXML, theResultTarget,psExecutionContext);
+ psExecutionContext.reset();
+ const double singleEnd = clock();
+ //cout << "Clock after single
transform: " << singleEnd << endl;
+ cout << "Single Transform time: " <<
singleEnd - singleStart << endl;
+
+
+
const double startTime = clock();
- cout << "Clock before transforms: " <<
startTime << endl;
+ //cout << endl << "Clock before
transforms: " << startTime << endl;
for(int j = 0; j < iterCount; ++j)
{
csProcessor.setStylesheetRoot(glbStylesheetRoot[ii]);
@@ -262,11 +295,11 @@
psExecutionContext.reset();
}
const double endTime = clock();
- cout << "Clock after transforms: " <<
endTime << endl;
- cout << "Total clock ticks: " <<
endTime - startTime << endl;
+ //cout << "Clock after transforms: " <<
endTime << endl;
+ //cout << "Total clock ticks: " <<
endTime - startTime << endl;
const double millis = ((endTime -
startTime) / CLOCKS_PER_SEC) * 1000.0;
- cout << "Milliseconds: " << millis <<
endl;
- cout << "Averaged: " << millis /
iterCount << " per iteration" << endl;
+ //cout << "Milliseconds: " << millis <<
endl;
+ cout << "Averaged: " << millis /
iterCount << " for " << iterCount << " iterations" << endl;
}
}