jsPerformance.pl

NAME
jsPerformance.pl - execute JavaScript programs in various shells in batch or single mode, reporting the time on tests.

REQUIREMENTS
jsPerformance.pl requires the Getopt::Mixed perl package, available from cpan.org
jsPerformance.pl requires a file called "config.txt" which is placed as a peer of  jsPerformance.pl.
                             List your machine specs in the order of "OS-PROCESSOR-RAM". 
                             For example in text file, the first line could read :Windows2000-1.7GHz-256MB
SYNOPSIS
jsPerformance.pl [-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}

      * Please see README-jsDriver.pl for details about the several different options that jsPerformance.pl has.
             
EXAMPLES
perl jsPerformance.pl -e smopt
Executes all tests against the optimized SpiderMonkey shell, writing the results to the default result file. 

perl jsPerformance.pl -e smopt -f TEST.html
Executes all tests against the optimized SpiderMonkey shell, writing the results to the TEST.html  file. 

perl jsDriver.pl -e smopt -l tests/number
Executes all tests in the tests/number folder against the optimized Spider Monkey shell.


DESCRIPTION
   
 jsPerformance.pl 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 

 perl jsPerformance.pl -e smopt -s D:/JS_TRUNK/mozilla/js/src/WINNT5.0_OPT.OBJ/js.exe 

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".


RESULTS

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.  

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!".


After the user clicks on the configurations folder, the timing results are displayed like the following screen shot.


The first column lists the date and time the test was completed. The second colums lists the timing result for that method in milliseconds. 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.


The bottom is a sample screen shot of the HTML file that jsPerformance.pl generates. 
      
      


TO DO  

This test suite is not finished.  The JavaScript files have not all been created to properly test the performance of JavaScript.

Currently the results are posted locally as a peer file to jsPerformance.pl, and to a server in directory-structure format. For example,
[DIR] Math.PI/   ---> win2k-1.7ghz-256mb ---> results of test


in the "win2k-1.7ghz-256mb" file are the outputs shown:
 2002:10:25:17:49:20  4516 Math.PI  10.169.106.116 win2k-1.7ghz-256mb libwww-perl/5.65
 2002:10:28:18:09:30  4531 Math.PI 10.169.106.11  win2k-1.7ghz-256mb libwww-perl/5.65


and create another folder with:
[DIR] Math.abs(-180)/    ---> win2k-1.7ghz-256mb --->results of test


in the "win2k-1.7ghz-256mb" file are the outputs shown:
2002:10:25:17:49:20   922 Math.abs(-180)  10.169.106.116 win2k-1.7ghz-256mb libwww-perl/5.65
2002:10:28:18:09:30   953 Math.abs(-180)  10.169.106.116 win2k-1.7ghz-256mb libwww-perl/5.65



"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. 
Everytime the test is run, it will generate a unique ID.

The advantage of this is that you can just search for the unique ID ("XYZ"),
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:

URL: report.pl?id=XYZ
Math.PI       win2k-1.7ghz-256mb     4531
Math.abs(-180) win2k-1.7ghz-256mb     922

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:

D:/JS_TRUNK/mozilla/js/src/WINNT5.0_OPT.OBJ/js.exe -f ./tests/shell.js -f ./tests/boolean/valueOf-001.js

Notice the first -f loads a file containing utility reporting functions: ./tests/shell.js.
Only then is the testcase itself loaded: ./tests/boolean/valueOf-001.js.

If the CScript shell has no analogue of the -f option a workaround will have to be found.

SEE ALSO
jsDriver.pl, README-jsDriver.pl

Author: Mazie Lobo