2003-12-08 21:44:55 +03:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>jsPerformance.pl - Netscape</title>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt><br>
|
|
|
|
</dt>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
<div align="center"><big><b><big><big>jsPerformance.pl</big></big></b></big><br>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt><br>
|
|
|
|
<b>NAME <br>
|
|
|
|
</b></dt>
|
|
|
|
<dd><b> jsPerformance.pl</b> - execute JavaScript programs
|
|
|
|
in various shells in batch or single mode, reporting the time
|
|
|
|
on tests. <br>
|
|
|
|
</dd>
|
|
|
|
<dd><br>
|
|
|
|
</dd>
|
|
|
|
<dt><b>REQUIREMENTS</b></dt>
|
|
|
|
<dd> <b>jsPerformance.pl</b> requires the <a
|
|
|
|
href="http://search.cpan.org/search?module=Getopt::Mixed">Getopt::Mixed</a>
|
|
|
|
perl package, available from <a
|
|
|
|
href="http://www.cpan.org">cpan.org</a>. </dd>
|
|
|
|
<dd> <b>jsPerformance.pl</b> requires a file called "<b>config.txt</b>"
|
|
|
|
which is placed as a peer of <b>jsPerformance.pl</b>.</dd>
|
|
|
|
<dd>
|
|
|
|
List your machine specs
|
|
|
|
in the order of "OS-PROCESSOR-RAM". </dd>
|
|
|
|
<dd>
|
|
|
|
For example in text
|
|
|
|
file, the first line could read :Windows2000-1.7GHz-256MB</dd>
|
|
|
|
<dt><b>SYNOPSIS</b></dt>
|
|
|
|
<dd>
|
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td align="right" valign="top"> <font
|
|
|
|
face="Times New Roman, Times, serif"> <b>jsPerformance.pl</b>
|
|
|
|
</font> </td>
|
|
|
|
<td> <code> [-hkt]
|
|
|
|
[-b BUGURL] [-c CLASSPATH] [-f OUTFILE] [-j JAVAPATH]
|
|
|
|
[-l TESTLIST ...] [-L NEGLIST ...] [-p TESTPATH] [-s SHELLPATH]
|
|
|
|
[-u LXRURL] [--help] [--confail] [--trace] [--classpath=CLASSPATH]
|
|
|
|
[--file=OUTFILE] [--javapath=JAVAPATH] [--list=TESTLIST]
|
|
|
|
[--neglist=TESTLIST] [--testpath=TESTPATH] [--shellpath=SHELLPATH]
|
|
|
|
[--lxrurl=LXRURL] {-e ENGINETYPE | --engine=ENGINETYPE}
|
|
|
|
</code> </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<br>
|
|
|
|
</dd>
|
|
|
|
<dt> * Please see <a
|
|
|
|
href="http://lxr.mozilla.org/mozilla/source/js/tests/README-jsDriver.html">README-jsDriver.pl</a>
|
|
|
|
for details about the several different options that
|
|
|
|
jsPerformance.pl has.<br>
|
|
|
|
</dt>
|
|
|
|
<dd> <br>
|
|
|
|
</dd>
|
|
|
|
<dt><b>EXAMPLES</b></dt>
|
|
|
|
<dd> <code>perl jsPerformance.pl -e smopt </code><br>
|
|
|
|
Executes all tests
|
|
|
|
against the optimized SpiderMonkey shell, writing
|
|
|
|
the results to the default result file. </dd>
|
|
|
|
<dd><br>
|
|
|
|
</dd>
|
|
|
|
<dd> <code>perl jsPerformance.pl -e smopt -f TEST.html</code><br>
|
|
|
|
Executes all tests
|
|
|
|
against the optimized SpiderMonkey shell, writing
|
|
|
|
the results to the TEST.html file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p> <code>perl jsDriver.pl -e smopt -l tests/number</code><br>
|
|
|
|
Executes all tests
|
|
|
|
in the <code>tests/number </code>folder against
|
|
|
|
the optimized Spider Monkey shell. </p>
|
|
|
|
</dd>
|
|
|
|
<dt><br>
|
|
|
|
<b>DESCRIPTION </b><br>
|
|
|
|
</dt>
|
|
|
|
<dd><b> jsPerformance.pl</b> is normally used to run a series of
|
|
|
|
tests measuring the performance of JavaScript against one of the JavaScript
|
|
|
|
shells. The engine option above (-e) expects the JS shell to be
|
|
|
|
in a peer directory. For example, if jsPerformance.pl is in a location
|
|
|
|
like mozilla/js/perf/jsPerformance.pl, the engine option -e smopt will expect
|
|
|
|
the optimized SpiderMonkey shell to be in a location like mozilla/js/src/WINNT5.0_OPT.OBJ/js.exe.
|
|
|
|
If the JS shell is in a different location, this can be specified with
|
|
|
|
the (-s) option, for example </dd>
|
|
|
|
<dd><br>
|
|
|
|
</dd>
|
|
|
|
<dd> perl jsPerformance.pl -e smopt -s D:/JS_TRUNK/mozilla/js/src/WINNT5.0_OPT.OBJ/js.exe </dd>
|
|
|
|
<dd><br>
|
|
|
|
</dd>
|
|
|
|
<dd>The timing results are displayed on the machine locally, peer to
|
|
|
|
jsPerformance.pl. If no file name is provided using the (-f) option, then
|
|
|
|
a time stamped file name is generated. The timing results are also sent
|
|
|
|
to the server. The variable "$server" stores the value for the location
|
|
|
|
of the server where the results are sent to. The following is a screen
|
|
|
|
shot of the jsPerformance.pl, and highlighted is the variable "$server".</dd>
|
|
|
|
<dd><img src="images/server.jpg">
|
|
|
|
</dd>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<b>RESULTS</b><br>
|
|
|
|
<dd><br>
|
|
|
|
The picure below is a screen shot of
|
|
|
|
a database that lies on the server. After the tests are run,
|
|
|
|
it creates folders based on the JavaScript method you are testing.
|
|
|
|
<img src="images/methodfolder.jpg">
|
|
|
|
</dd>
|
|
|
|
<br>
|
|
|
|
<dd>Once the user clicks on the JavaScript method folder, inside are folders
|
|
|
|
based on the machine specifcations based from the "config.txt"
|
|
|
|
file which the user supplies. If a user does not provide a
|
|
|
|
"config.txt" file, the timing results are sent to a default folder
|
|
|
|
called "no machine specs!". <img
|
|
|
|
src="images/folderspecslarge.jpg">
|
|
|
|
</dd>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<dd>After the user clicks on the configurations folder, the timing results
|
|
|
|
are displayed like the following screen shot. <img
|
|
|
|
src="images/timeresults.jpg">
|
|
|
|
</dd>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<dd>The first column lists the date and time the test was completed. The
|
|
|
|
second colums lists the timing result for that method in miliseconds.
|
|
|
|
In the third column is the JavaScript method that the user is testing.
|
|
|
|
The fourth column is the IP of the computer which the test was run
|
|
|
|
on. In the fifth column, are the configurations of the computer.
|
|
|
|
</dd>
|
|
|
|
<dd><img src="images/resultclose.jpg">
|
|
|
|
</dd>
|
|
|
|
<dd><br>
|
|
|
|
</dd>
|
|
|
|
<dd><br>
|
|
|
|
</dd>
|
|
|
|
<dd>The bottom is a sample screen shot of the HTML file that jsPerformance.pl
|
|
|
|
generates. </dd>
|
|
|
|
<dd><img src="images/html.jpg" alt="" width="537" height="613">
|
|
|
|
</dd>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<b>TO DO <br>
|
|
|
|
</b>
|
|
|
|
<dl>
|
|
|
|
<b><br>
|
|
|
|
</b>This test suite is not finished. The JavaScript
|
|
|
|
files have not all been created to properly test the performance of
|
|
|
|
JavaScript.<br>
|
|
|
|
<b> <br>
|
|
|
|
</b>Currently the results are posted
|
|
|
|
locally as a peer file to jsPerformance.pl, and to a server
|
|
|
|
in directory-structure format. For example,<br>
|
|
|
|
</dl>
|
2003-12-09 01:25:20 +03:00
|
|
|
<dd> <img src="images/folder.jpg" alt="[DIR]" width="14"
|
2003-12-08 21:44:55 +03:00
|
|
|
height="12">
|
|
|
|
Math.PI/ ---> win2k-1.7ghz-256mb ---> results
|
|
|
|
of test</dd>
|
|
|
|
<br>
|
|
|
|
<dl>
|
|
|
|
<br>
|
|
|
|
in the "win2k-1.7ghz-256mb" file are the outputs shown:<br>
|
|
|
|
<dd> 2002:10:25:17:49:20 4516 Math.PI 10.169.106.116 win2k-1.7ghz-256mb
|
|
|
|
libwww-perl/5.65<br>
|
|
|
|
2002:10:28:18:09:30 4531 Math.PI 10.169.106.11 win2k-1.7ghz-256mb
|
|
|
|
libwww-perl/5.65</dd>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
and create another folder with:<br>
|
|
|
|
</dl>
|
2003-12-09 01:25:20 +03:00
|
|
|
<dd><img src="images/folder.jpg"
|
2003-12-08 21:44:55 +03:00
|
|
|
alt="[DIR]" width="14" height="12">
|
|
|
|
Math.abs(-180)/ ---> win2k-1.7ghz-256mb --->results
|
|
|
|
of test</dd>
|
|
|
|
<br>
|
|
|
|
<dl>
|
|
|
|
<br>
|
|
|
|
in the "win2k-1.7ghz-256mb" file are the outputs shown:<br>
|
|
|
|
<dd> 2002:10:25:17:49:20 922 Math.abs(-180) 10.169.106.116 win2k-1.7ghz-256mb
|
|
|
|
libwww-perl/5.65<br>
|
|
|
|
2002:10:28:18:09:30 953 Math.abs(-180)
|
|
|
|
10.169.106.116 win2k-1.7ghz-256mb libwww-perl/5.65</dd>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
"Math.abs(-180)" and "Math.PI" may be replaced by "ABC" and "XYZ" which could
|
|
|
|
be used as unique ID's that are assigned each time the
|
|
|
|
test is run. <br>
|
|
|
|
Everytime the test is run, it will generate a unique ID.<br>
|
|
|
|
<br>
|
2003-12-13 22:37:43 +03:00
|
|
|
The advantage of this is that you can just search for the unique ID ("XYZ"),<br>
|
2003-12-08 21:44:55 +03:00
|
|
|
and it will parse through all the folders and files...and look for that unique
|
|
|
|
ID, and it will print it out like the following:<br>
|
|
|
|
<br>
|
|
|
|
URL: report.pl?id=XYZ<br>
|
|
|
|
Math.PI win2k-1.7ghz-256mb 4531<br>
|
|
|
|
Math.abs(-180) win2k-1.7ghz-256mb 922<br>
|
|
|
|
<br>
|
|
|
|
We would like to extend our testing to the CScript shell of Microsoft.
|
|
|
|
However, the CScript shell may not support the
|
|
|
|
-f option of the SpiderMonkey shell. Our test driver opens
|
|
|
|
a process such as:<br>
|
|
|
|
<br>
|
|
|
|
D:/JS_TRUNK/mozilla/js/src/WINNT5.0_OPT.OBJ/js.exe -f ./tests/shell.js
|
|
|
|
-f ./tests/boolean/valueOf-001.js<br>
|
|
|
|
<br>
|
|
|
|
Notice the first -f loads a file containing utility reporting functions:
|
|
|
|
./tests/shell.js. <br>
|
|
|
|
Only then is the testcase itself loaded: ./tests/boolean/valueOf-001.js.<br>
|
|
|
|
<br>
|
|
|
|
If the CScript shell has no analogue of the -f option a workaround will have
|
|
|
|
to be found.
|
|
|
|
</dl>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt><br>
|
|
|
|
</dt>
|
|
|
|
<dt><b>SEE ALSO</b></dt>
|
|
|
|
<dd> <a
|
|
|
|
href="http://lxr.mozilla.org/mozilla/source/js/tests/jsDriver.pl">jsDriver.pl</a>,
|
|
|
|
<a
|
|
|
|
href="http://lxr.mozilla.org/mozilla/source/js/tests/README-jsDriver.html">README-jsDriver.pl</a><br>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
<hr>Author: Mazie Lobo<br>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|