src/demo/share/java2d/J2DBench/README
author michaelm
Thu, 14 Nov 2019 15:01:49 +0000
branchunixdomainchannels
changeset 59082 5e250ee9259e
parent 47216 71c04702a3d5
permissions -rw-r--r--
unixdomainchannels: fix some sockaddr_un address handling
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
Introduction
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
J2DBench is a  suite of benchmarks with a GUI front  end that lets you
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
analyze the  performance of many Java2D graphical  operations. You can
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
easily modify  the test  options, and save  them for later  runs using
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
GUI, or  load them in batch  mode to allow quick  testing on different
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
builds.   It  also  provides  logging  of  the  result,  to  make  the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
comparison of the collected data easier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
J2DAnalyzer  is  J2DBench  a  results  analyzer/comparator  which  can
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
compare the results generated by the J2DBench runs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
XMLHTMLReporter is an additional tool  which can create an html report
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
from the results files generated by the J2DBench runs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
Minimum requirements
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
26349
137d39d10ffa 8042199: The build of J2DBench via makefile is broken after the JDK-8005402
serb
parents: 2
diff changeset
    22
The benchmark requires at least jdk1.4 to compile and run. Note that
137d39d10ffa 8042199: The build of J2DBench via makefile is broken after the JDK-8005402
serb
parents: 2
diff changeset
    23
source/target is set to 1.6 in the makefile and build.xml, because of
137d39d10ffa 8042199: The build of J2DBench via makefile is broken after the JDK-8005402
serb
parents: 2
diff changeset
    24
support in jdk 9 compiler.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
How To Compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#> cd J2DBench
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
The benchmark can be compiled by using either ant:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#> ant
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
or gnumake (assuming there's 'javac' in the path):
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#> gnumake
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
The jar files will be generated into J2DBench/dist directory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
Note that the workspace also contains Netbeans 4.0 project file:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
  J2DBench/nbproject/project.xml
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
allowing it to be easily imported into Netbeans.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
How To Run J2DBench, J2DAnalyzer, XMLHTMLReporter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#> ant run
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
  or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#> java -jar dist/J2DBench.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
To get help page for each of the tools, run:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#> java -jar dist/J2DBench.jar -help
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
#> java -jar dist/J2DAnalyzer.jar -help
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
#> java -cp dist/J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter -help
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
Using J2DBench GUI to Create Options File
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
There are global  options, options specific to a  group of benchmarks,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
and benchmark-specific options.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
Global  options affect all  groups of  benchmarks, group  options only
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
affect benchmarks in particular group, and benchmark-specific ones are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
relevant to a single benchmark.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
Examples of important global options:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
  Calibration: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    if the "Fixed Number of reps" is set to 0, J2DBench will calibrate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    each individual benchmark, meaning that it will determine how many
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    repetitions each benchmark can perform in "Target Test Time", and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    use this number of repetitions for each Test Run.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    If "Fixed Number of reps" is non-0, each benchmark will be run for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    specified number  of repetitions.  The use of  Calibration mode is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    preferable because  the time per  operation can vary  widely among
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    the various tests.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
  Output Destinations: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    where the benchmarks will render to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    All selected  benchmarks will be repeated for each selected
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    destination.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
Example of benchmark group options:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
TextBenchmarks/TextOptions/Graphics
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
  Text AntiAlias: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    whether to use text antialiasing for text benchmarks
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
Example of a benchmark option:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
Graphics Benchmarks/Imaging Benchmarks:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
  Image Rendering Sources (for Imaging Benchmarks only): 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    the source image types used for testing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
Example of a benchmark:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
Graphics Benchmarks/Imaging Benchmarks/Image Rendering Tests:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
  drawImage(img, tx, obs): 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    test the Graphics2D's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
      drawImage(Image image, AffineTransform tx, ImageObserver obs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    operation. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
General note: you can chose multiple options in some cases by holding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
Shift or Ctrl key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
Use Scenario
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
-----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
Suppose you want to compare rendering performance of the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
and opengl pipelines.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
Start J2DBench (assuming the current dir is J2DBench's top dir)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
#> java -jar dist/J2DBench.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
You can  either create and save  the option file  by selecting desired
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
tests and their attributes, or use one of the provided option files in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
options/ directory (for example, default.opt, which is used below).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
Note that it's very easy to  create an option file which would take an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
extremely  long time  to  execute the  tests,  so be  be careful  when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
choosing the options and benchmarks to run.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
After the options file is created, start J2DBench in batch mode to run
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
the benchmarks for the default pipeline:
26349
137d39d10ffa 8042199: The build of J2DBench via makefile is broken after the JDK-8005402
serb
parents: 2
diff changeset
   127
#> java -jar dist/J2DBench.jar -batch -loadopts options/default.opt \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     -saveres default.res -title "Rendering - Default ppl" \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     -desc "Rendering tests with the default pipeline"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
This command  will run  the benchmarks defined  in options/default.opt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
file and save the result in default.res file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
(You can also run selected tests directly from the GUI mode by hitting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
"Run Tests" in the J2DBench dialog)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
Now run the benchmark with opengl pipeline:
26349
137d39d10ffa 8042199: The build of J2DBench via makefile is broken after the JDK-8005402
serb
parents: 2
diff changeset
   138
#> java -Dsun.java2d.opengl=True -jar dist/J2DBench.jar -batch \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     -loadopts options/default.opt \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     -saveres opengl.res -title "Rendering - OpenGL" \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     -desc "Rendering tests with OpenGL pipeline"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
Now let's analyze the results using J2DAnalyzer:
26349
137d39d10ffa 8042199: The build of J2DBench via makefile is broken after the JDK-8005402
serb
parents: 2
diff changeset
   144
#> java -jar dist/J2DAnalyzer.jar default.res opengl.res
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
Note that you can compare more than two sets of results, see
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
J2DAnalyzer's help page.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
You can also generate html pages from the results files using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
j2dbench.report.XMLHTMLReporter class in J2DAnalyzer.jar.  Suppose
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
generated pages are to be stored in html_results directory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
First, make sure html_results/testcases directory exists:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
#> mkdir -p html_results/testcases
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
Then generate the report:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#> java -cp J2DAnalyzer.jar j2dbench.report.XMLHTMLReporter \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     -r html_results -b default.res -t opengl.res
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
The html report will be generated in html_results/ directory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
The index page:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
  html_results/Summary_Report.html