-----------------------------------------------------------------------Introduction-----------------------------------------------------------------------J2DBench is a suite of benchmarks with a GUI front end that lets youanalyze the performance of many Java2D graphical operations. You caneasily modify the test options, and save them for later runs usingGUI, or load them in batch mode to allow quick testing on differentbuilds. It also provides logging of the result, to make thecomparison of the collected data easier.J2DAnalyzer is J2DBench a results analyzer/comparator which cancompare the results generated by the J2DBench runs.XMLHTMLReporter is an additional tool which can create an html reportfrom the results files generated by the J2DBench runs.-----------------------------------------------------------------------Minimum requirements-----------------------------------------------------------------------The benchmark requires at least jdk1.4 to compile and run. Note thatsource/target is set to 1.6 in the makefile and build.xml, because ofsupport in jdk 9 compiler.-----------------------------------------------------------------------How To Compile-----------------------------------------------------------------------#> cd J2DBenchThe benchmark can be compiled by using either ant:#> antor gnumake (assuming there's 'javac' in the path):#> gnumakeThe jar files will be generated into J2DBench/dist directory.Note that the workspace also contains Netbeans 4.0 project file: J2DBench/nbproject/project.xmlallowing it to be easily imported into Netbeans.-----------------------------------------------------------------------How To Run J2DBench, J2DAnalyzer, XMLHTMLReporter-----------------------------------------------------------------------#> ant run or#> java -jar dist/J2DBench.jarTo get help page for each of the tools, run:#> java -jar dist/J2DBench.jar -help#> java -jar dist/J2DAnalyzer.jar -help#> java -cp dist/J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter -help-----------------------------------------------------------------------Using J2DBench GUI to Create Options File-----------------------------------------------------------------------There are global options, options specific to a group of benchmarks,and benchmark-specific options.Global options affect all groups of benchmarks, group options onlyaffect benchmarks in particular group, and benchmark-specific ones arerelevant to a single benchmark.Examples of important global options: Calibration: if the "Fixed Number of reps" is set to 0, J2DBench will calibrate each individual benchmark, meaning that it will determine how many repetitions each benchmark can perform in "Target Test Time", and use this number of repetitions for each Test Run. If "Fixed Number of reps" is non-0, each benchmark will be run for specified number of repetitions. The use of Calibration mode is preferable because the time per operation can vary widely among the various tests. Output Destinations: where the benchmarks will render to. All selected benchmarks will be repeated for each selected destination.Example of benchmark group options:TextBenchmarks/TextOptions/Graphics Text AntiAlias: whether to use text antialiasing for text benchmarksExample of a benchmark option:Graphics Benchmarks/Imaging Benchmarks: Image Rendering Sources (for Imaging Benchmarks only): the source image types used for testingExample of a benchmark:Graphics Benchmarks/Imaging Benchmarks/Image Rendering Tests: drawImage(img, tx, obs): test the Graphics2D's drawImage(Image image, AffineTransform tx, ImageObserver obs) operation. General note: you can chose multiple options in some cases by holdingShift or Ctrl key.-----------------------------------------------------------------------Use Scenario-----------------------------------------------------------------------Suppose you want to compare rendering performance of the defaultand opengl pipelines.Start J2DBench (assuming the current dir is J2DBench's top dir)#> java -jar dist/J2DBench.jarYou can either create and save the option file by selecting desiredtests and their attributes, or use one of the provided option files inoptions/ directory (for example, default.opt, which is used below).Note that it's very easy to create an option file which would take anextremely long time to execute the tests, so be be careful whenchoosing the options and benchmarks to run.After the options file is created, start J2DBench in batch mode to runthe benchmarks for the default pipeline:#> java -jar dist/J2DBench.jar -batch -loadopts options/default.opt \ -saveres default.res -title "Rendering - Default ppl" \ -desc "Rendering tests with the default pipeline"This command will run the benchmarks defined in options/default.optfile and save the result in default.res file.(You can also run selected tests directly from the GUI mode by hitting"Run Tests" in the J2DBench dialog)Now run the benchmark with opengl pipeline:#> java -Dsun.java2d.opengl=True -jar dist/J2DBench.jar -batch \ -loadopts options/default.opt \ -saveres opengl.res -title "Rendering - OpenGL" \ -desc "Rendering tests with OpenGL pipeline"Now let's analyze the results using J2DAnalyzer:#> java -jar dist/J2DAnalyzer.jar default.res opengl.resNote that you can compare more than two sets of results, seeJ2DAnalyzer's help page.You can also generate html pages from the results files usingj2dbench.report.XMLHTMLReporter class in J2DAnalyzer.jar. Supposegenerated pages are to be stored in html_results directory.First, make sure html_results/testcases directory exists:#> mkdir -p html_results/testcasesThen generate the report:#> java -cp J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter \ -r html_results -b default.res -t opengl.resThe html report will be generated in html_results/ directory.The index page: html_results/Summary_Report.html