gecko-dev/js/perf/README-jsPerformance.html
pschwartau%netscape.com c8302041c3 Correcting a typo.
2003-12-13 19:37:43 +00:00

253 lines
12 KiB
HTML

<!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>.&nbsp;</dd>
<dd> <b>jsPerformance.pl</b> requires a file called "<b>config.txt</b>"
which is placed as a peer of&nbsp; <b>jsPerformance.pl</b>.</dd>
<dd> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;List your machine specs
in the order of "OS-PROCESSOR-RAM".&nbsp;</dd>
<dd>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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>&nbsp; &nbsp; &nbsp; * 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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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.&nbsp;</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&nbsp; file.&nbsp;
<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>
&nbsp;&nbsp;&nbsp;</dt>
<dd><b>&nbsp;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) &nbsp;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&nbsp;</dd>
<dd><br>
</dd>
<dd>&nbsp;perl jsPerformance.pl -e smopt -s D:/JS_TRUNK/mozilla/js/src/WINNT5.0_OPT.OBJ/js.exe&nbsp;</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">
&nbsp;</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.&nbsp;</dd>
<dd><img src="images/html.jpg" alt="" width="537" height="613">
</dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
<br>
<br>
<b>TO DO &nbsp;<br>
</b>
<dl>
<b><br>
</b>This test suite is not finished. &nbsp;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>
<dd> <img src="images/folder.jpg" alt="[DIR]" width="14"
height="12">
Math.PI/&nbsp;&nbsp;&nbsp;---&gt;&nbsp;win2k-1.7ghz-256mb&nbsp;---&gt;&nbsp;results
of test</dd>
<br>
<dl>
<br>
in the "win2k-1.7ghz-256mb" file are the outputs shown:<br>
<dd> &nbsp;2002:10:25:17:49:20&nbsp;&nbsp;4516 Math.PI &nbsp;10.169.106.116&nbsp;win2k-1.7ghz-256mb
libwww-perl/5.65<br>
&nbsp;2002:10:28:18:09:30&nbsp;&nbsp;4531 Math.PI 10.169.106.11&nbsp;&nbsp;win2k-1.7ghz-256mb
libwww-perl/5.65</dd>
<br>
<br>
and create another folder with:<br>
</dl>
<dd><img src="images/folder.jpg"
alt="[DIR]" width="14" height="12">
Math.abs(-180)/&nbsp;&nbsp;&nbsp;&nbsp;---&gt;&nbsp;win2k-1.7ghz-256mb&nbsp;---&gt;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&nbsp;&nbsp;&nbsp;922 Math.abs(-180)&nbsp; 10.169.106.116&nbsp;win2k-1.7ghz-256mb
libwww-perl/5.65<br>
2002:10:28:18:09:30&nbsp;&nbsp;&nbsp;953 Math.abs(-180)&nbsp;
10.169.106.116&nbsp;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.&nbsp;<br>
Everytime the test is run,&nbsp;it will generate a unique ID.<br>
<br>
The advantage of this is that you can just search for the unique ID ("XYZ"),<br>
and it will parse through all the folders and files...and look for that unique
ID,&nbsp;and it will print it out like the following:<br>
<br>
URL: report.pl?id=XYZ<br>
Math.PI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;win2k-1.7ghz-256mb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4531<br>
Math.abs(-180) win2k-1.7ghz-256mb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;922<br>
<br>
We would like to extend our testing to the CScript shell of Microsoft.
&nbsp;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&nbsp;-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>