0N/A-----------------------------------------------------------------------
0N/AIntroduction
0N/A-----------------------------------------------------------------------
0N/A
0N/AJ2DBench is a suite of benchmarks with a GUI front end that lets you
0N/Aanalyze the performance of many Java2D graphical operations. You can
0N/Aeasily modify the test options, and save them for later runs using
0N/AGUI, or load them in batch mode to allow quick testing on different
0N/Abuilds. It also provides logging of the result, to make the
0N/Acomparison of the collected data easier.
0N/A
0N/AJ2DAnalyzer is J2DBench a results analyzer/comparator which can
0N/Acompare the results generated by the J2DBench runs.
0N/A
0N/AXMLHTMLReporter is an additional tool which can create an html report
0N/Afrom the results files generated by the J2DBench runs.
0N/A
0N/A-----------------------------------------------------------------------
0N/AMinimum requirements
0N/A-----------------------------------------------------------------------
0N/A
0N/AThe benchmark requires at least jdk1.4 to compile and
0N/Aat least jdk1.2** to run.
0N/A
0N/A** Note: the goal is to make the benchmark run on 1.1.x as well.
0N/A
0N/A-----------------------------------------------------------------------
0N/AHow To Compile
0N/A-----------------------------------------------------------------------
0N/A
0N/A#> cd J2DBench
0N/A
0N/AThe benchmark can be compiled by using either ant:
0N/A
0N/A#> ant
0N/A
0N/Aor gnumake (assuming there's 'javac' in the path):
0N/A
0N/A#> gnumake
0N/A
0N/AThe jar files will be generated into J2DBench/dist directory.
0N/A
0N/ANote that the workspace also contains Netbeans 4.0 project file:
0N/A J2DBench/nbproject/project.xml
0N/Aallowing it to be easily imported into Netbeans.
0N/A
0N/A-----------------------------------------------------------------------
0N/AHow To Run J2DBench, J2DAnalyzer, XMLHTMLReporter
0N/A-----------------------------------------------------------------------
0N/A
0N/A#> ant run
0N/A or
0N/A#> java -jar dist/J2DBench.jar
0N/A
0N/ATo get help page for each of the tools, run:
0N/A#> java -jar dist/J2DBench.jar -help
0N/A#> java -jar dist/J2DAnalyzer.jar -help
0N/A#> java -cp dist/J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter -help
0N/A
0N/A-----------------------------------------------------------------------
0N/AUsing J2DBench GUI to Create Options File
0N/A-----------------------------------------------------------------------
0N/A
0N/AThere are global options, options specific to a group of benchmarks,
0N/Aand benchmark-specific options.
0N/A
0N/AGlobal options affect all groups of benchmarks, group options only
0N/Aaffect benchmarks in particular group, and benchmark-specific ones are
0N/Arelevant to a single benchmark.
0N/A
0N/AExamples of important global options:
0N/A Calibration:
0N/A if the "Fixed Number of reps" is set to 0, J2DBench will calibrate
0N/A each individual benchmark, meaning that it will determine how many
0N/A repetitions each benchmark can perform in "Target Test Time", and
0N/A use this number of repetitions for each Test Run.
0N/A
0N/A If "Fixed Number of reps" is non-0, each benchmark will be run for
0N/A specified number of repetitions. The use of Calibration mode is
0N/A preferable because the time per operation can vary widely among
0N/A the various tests.
0N/A
0N/A Output Destinations:
0N/A where the benchmarks will render to.
0N/A All selected benchmarks will be repeated for each selected
0N/A destination.
0N/A
0N/AExample of benchmark group options:
0N/ATextBenchmarks/TextOptions/Graphics
0N/A Text AntiAlias:
0N/A whether to use text antialiasing for text benchmarks
0N/A
0N/AExample of a benchmark option:
0N/AGraphics Benchmarks/Imaging Benchmarks:
0N/A Image Rendering Sources (for Imaging Benchmarks only):
0N/A the source image types used for testing
0N/A
0N/AExample of a benchmark:
0N/AGraphics Benchmarks/Imaging Benchmarks/Image Rendering Tests:
0N/A drawImage(img, tx, obs):
0N/A test the Graphics2D's
0N/A drawImage(Image image, AffineTransform tx, ImageObserver obs)
0N/A operation.
0N/A
0N/AGeneral note: you can chose multiple options in some cases by holding
0N/AShift or Ctrl key.
0N/A
0N/A-----------------------------------------------------------------------
0N/AUse Scenario
0N/A-----------------------------------------------------------------------
0N/A
0N/ASuppose you want to compare rendering performance of the default
0N/Aand opengl pipelines.
0N/A
0N/AStart J2DBench (assuming the current dir is J2DBench's top dir)
0N/A#> java -jar dist/J2DBench.jar
0N/A
0N/AYou can either create and save the option file by selecting desired
0N/Atests and their attributes, or use one of the provided option files in
0N/Aoptions/ directory (for example, default.opt, which is used below).
0N/A
0N/ANote that it's very easy to create an option file which would take an
0N/Aextremely long time to execute the tests, so be be careful when
0N/Achoosing the options and benchmarks to run.
0N/A
0N/AAfter the options file is created, start J2DBench in batch mode to run
0N/Athe benchmarks for the default pipeline:
0N/A#> java -jar dest/J2DBench.jar -batch -loadopts options/default.opt \
0N/A -saveres default.res -title "Rendering - Default ppl" \
0N/A -desc "Rendering tests with the default pipeline"
0N/A
0N/AThis command will run the benchmarks defined in options/default.opt
0N/Afile and save the result in default.res file.
0N/A
0N/A(You can also run selected tests directly from the GUI mode by hitting
0N/A"Run Tests" in the J2DBench dialog)
0N/A
0N/ANow run the benchmark with opengl pipeline:
0N/A#> java -Dsun.java2d.opengl=True -jar dest/J2DBench.jar -batch \
0N/A -loadopts options/default.opt \
0N/A -saveres opengl.res -title "Rendering - OpenGL" \
0N/A -desc "Rendering tests with OpenGL pipeline"
0N/A
0N/ANow let's analyze the results using J2DAnalyzer:
0N/A#> java -jar dest/J2DAnalyzer.jar default.res opengl.res
0N/A
0N/ANote that you can compare more than two sets of results, see
0N/AJ2DAnalyzer's help page.
0N/A
0N/AYou can also generate html pages from the results files using
0N/Aj2dbench.report.XMLHTMLReporter class in J2DAnalyzer.jar. Suppose
0N/Agenerated pages are to be stored in html_results directory.
0N/A
0N/AFirst, make sure html_results/testcases directory exists:
0N/A#> mkdir -p html_results/testcases
0N/A
0N/AThen generate the report:
0N/A#> java -cp J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter \
0N/A -r html_results -b default.res -t opengl.res
0N/A
0N/AThe html report will be generated in html_results/ directory.
0N/AThe index page:
0N/A html_results/Summary_Report.html