src/share/demo/java2d/J2DBench/README

Print this page




   2 Introduction
   3 -----------------------------------------------------------------------
   4 
   5 J2DBench is a  suite of benchmarks with a GUI front  end that lets you
   6 analyze the  performance of many Java2D graphical  operations. You can
   7 easily modify  the test  options, and save  them for later  runs using
   8 GUI, or  load them in batch  mode to allow quick  testing on different
   9 builds.   It  also  provides  logging  of  the  result,  to  make  the
  10 comparison of the collected data easier.
  11 
  12 J2DAnalyzer  is  J2DBench  a  results  analyzer/comparator  which  can
  13 compare the results generated by the J2DBench runs.
  14 
  15 XMLHTMLReporter is an additional tool  which can create an html report
  16 from the results files generated by the J2DBench runs.
  17 
  18 -----------------------------------------------------------------------
  19 Minimum requirements
  20 -----------------------------------------------------------------------
  21 
  22 The benchmark requires at least jdk1.4 to compile and
  23 at least jdk1.2** to run.
  24 
  25 ** Note: the goal is to make the benchmark run on 1.1.x as well.
  26 
  27 -----------------------------------------------------------------------
  28 How To Compile
  29 -----------------------------------------------------------------------
  30 
  31 #> cd J2DBench
  32 
  33 The benchmark can be compiled by using either ant:
  34 
  35 #> ant
  36 
  37 or gnumake (assuming there's 'javac' in the path):
  38 
  39 #> gnumake
  40 
  41 The jar files will be generated into J2DBench/dist directory.
  42 
  43 Note that the workspace also contains Netbeans 4.0 project file:
  44   J2DBench/nbproject/project.xml
  45 allowing it to be easily imported into Netbeans.


 108 -----------------------------------------------------------------------
 109 Use Scenario
 110 -----------------------------------------------------------------------
 111 
 112 Suppose you want to compare rendering performance of the default
 113 and opengl pipelines.
 114 
 115 Start J2DBench (assuming the current dir is J2DBench's top dir)
 116 #> java -jar dist/J2DBench.jar
 117 
 118 You can  either create and save  the option file  by selecting desired
 119 tests and their attributes, or use one of the provided option files in
 120 options/ directory (for example, default.opt, which is used below).
 121 
 122 Note that it's very easy to  create an option file which would take an
 123 extremely  long time  to  execute the  tests,  so be  be careful  when
 124 choosing the options and benchmarks to run.
 125 
 126 After the options file is created, start J2DBench in batch mode to run
 127 the benchmarks for the default pipeline:
 128 #> java -jar dest/J2DBench.jar -batch -loadopts options/default.opt \
 129      -saveres default.res -title "Rendering - Default ppl" \
 130      -desc "Rendering tests with the default pipeline"
 131 
 132 This command  will run  the benchmarks defined  in options/default.opt
 133 file and save the result in default.res file.
 134 
 135 (You can also run selected tests directly from the GUI mode by hitting
 136 "Run Tests" in the J2DBench dialog)
 137 
 138 Now run the benchmark with opengl pipeline:
 139 #> java -Dsun.java2d.opengl=True -jar dest/J2DBench.jar -batch \
 140      -loadopts options/default.opt \
 141      -saveres opengl.res -title "Rendering - OpenGL" \
 142      -desc "Rendering tests with OpenGL pipeline"
 143 
 144 Now let's analyze the results using J2DAnalyzer:
 145 #> java -jar dest/J2DAnalyzer.jar default.res opengl.res
 146 
 147 Note that you can compare more than two sets of results, see
 148 J2DAnalyzer's help page.
 149 
 150 You can also generate html pages from the results files using
 151 j2dbench.report.XMLHTMLReporter class in J2DAnalyzer.jar.  Suppose
 152 generated pages are to be stored in html_results directory.
 153 
 154 First, make sure html_results/testcases directory exists:
 155 #> mkdir -p html_results/testcases
 156 
 157 Then generate the report:
 158 #> java -cp J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter \
 159      -r html_results -b default.res -t opengl.res
 160 
 161 The html report will be generated in html_results/ directory.
 162 The index page:
 163   html_results/Summary_Report.html


   2 Introduction
   3 -----------------------------------------------------------------------
   4 
   5 J2DBench is a  suite of benchmarks with a GUI front  end that lets you
   6 analyze the  performance of many Java2D graphical  operations. You can
   7 easily modify  the test  options, and save  them for later  runs using
   8 GUI, or  load them in batch  mode to allow quick  testing on different
   9 builds.   It  also  provides  logging  of  the  result,  to  make  the
  10 comparison of the collected data easier.
  11 
  12 J2DAnalyzer  is  J2DBench  a  results  analyzer/comparator  which  can
  13 compare the results generated by the J2DBench runs.
  14 
  15 XMLHTMLReporter is an additional tool  which can create an html report
  16 from the results files generated by the J2DBench runs.
  17 
  18 -----------------------------------------------------------------------
  19 Minimum requirements
  20 -----------------------------------------------------------------------
  21 
  22 The benchmark requires at least jdk1.5 to compile and run.



  23 
  24 -----------------------------------------------------------------------
  25 How To Compile
  26 -----------------------------------------------------------------------
  27 
  28 #> cd J2DBench
  29 
  30 The benchmark can be compiled by using either ant:
  31 
  32 #> ant
  33 
  34 or gnumake (assuming there's 'javac' in the path):
  35 
  36 #> gnumake
  37 
  38 The jar files will be generated into J2DBench/dist directory.
  39 
  40 Note that the workspace also contains Netbeans 4.0 project file:
  41   J2DBench/nbproject/project.xml
  42 allowing it to be easily imported into Netbeans.


 105 -----------------------------------------------------------------------
 106 Use Scenario
 107 -----------------------------------------------------------------------
 108 
 109 Suppose you want to compare rendering performance of the default
 110 and opengl pipelines.
 111 
 112 Start J2DBench (assuming the current dir is J2DBench's top dir)
 113 #> java -jar dist/J2DBench.jar
 114 
 115 You can  either create and save  the option file  by selecting desired
 116 tests and their attributes, or use one of the provided option files in
 117 options/ directory (for example, default.opt, which is used below).
 118 
 119 Note that it's very easy to  create an option file which would take an
 120 extremely  long time  to  execute the  tests,  so be  be careful  when
 121 choosing the options and benchmarks to run.
 122 
 123 After the options file is created, start J2DBench in batch mode to run
 124 the benchmarks for the default pipeline:
 125 #> java -jar dist/J2DBench.jar -batch -loadopts options/default.opt \
 126      -saveres default.res -title "Rendering - Default ppl" \
 127      -desc "Rendering tests with the default pipeline"
 128 
 129 This command  will run  the benchmarks defined  in options/default.opt
 130 file and save the result in default.res file.
 131 
 132 (You can also run selected tests directly from the GUI mode by hitting
 133 "Run Tests" in the J2DBench dialog)
 134 
 135 Now run the benchmark with opengl pipeline:
 136 #> java -Dsun.java2d.opengl=True -jar dist/J2DBench.jar -batch \
 137      -loadopts options/default.opt \
 138      -saveres opengl.res -title "Rendering - OpenGL" \
 139      -desc "Rendering tests with OpenGL pipeline"
 140 
 141 Now let's analyze the results using J2DAnalyzer:
 142 #> java -jar dist/J2DAnalyzer.jar default.res opengl.res
 143 
 144 Note that you can compare more than two sets of results, see
 145 J2DAnalyzer's help page.
 146 
 147 You can also generate html pages from the results files using
 148 j2dbench.report.XMLHTMLReporter class in J2DAnalyzer.jar.  Suppose
 149 generated pages are to be stored in html_results directory.
 150 
 151 First, make sure html_results/testcases directory exists:
 152 #> mkdir -p html_results/testcases
 153 
 154 Then generate the report:
 155 #> java -cp J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter \
 156      -r html_results -b default.res -t opengl.res
 157 
 158 The html report will be generated in html_results/ directory.
 159 The index page:
 160   html_results/Summary_Report.html