RFR: 8278583: Open source SwingMark - Swing performance benchmark

Andrey Turbanov aturbanov at openjdk.org
Mon Apr 17 08:56:07 UTC 2023


On Sat, 15 Apr 2023 05:58:51 GMT, Phil Race <prr at openjdk.org> wrote:

> This is the SwingMark performance benchmark.
> It is very simplistic by today's standards but has been in use since 1998
> and gives a sense of changes that affect the UI stack not just core Java 2D
> tight loop rendering.
> It is mostly "as is" with these exceptions
> 
> 1) I did some tidying up of the woeful code formatting
> 2) I migrated some deprecated API and suppressed warnings for others (some future work there, but I didn't want to make changes that might affect comparisons)
> 3) I added a Makefile and support for building as a jar.
> 4) TestList.txt is a resource in the .jar so most folks don't need to worry about it
> 5) README is cleaned up and updated
> 6) I used the same licensing as J2DBench
> 7) I've put it alongside RenderPerfTest in the sources

test/jdk/performance/client/SwingMark/src/AbstractSwingTest.java line 135:

> 133:             if (test.getPaintCount() > 0) {
> 134:                System.out.println("Called Paint: " + test.getPaintCount() + " times");
> 135:             }  else {

nit
Suggestion:

            } else {

test/jdk/performance/client/SwingMark/src/AdvancedTextAreaTest.java line 128:

> 126: 
> 127:         public TextAppender(JTextArea textArea, String appendThis) {
> 128:             area =  textArea;

nit
Suggestion:

            area = textArea;

test/jdk/performance/client/SwingMark/src/AdvancedTextAreaTest.java line 141:

> 139: 
> 140:         public TextCutter(JTextArea textArea) {
> 141:             area =  textArea;

nit
Suggestion:

            area = textArea;

test/jdk/performance/client/SwingMark/src/AdvancedTextAreaTest.java line 153:

> 151: 
> 152:         public TextCopier(JTextArea textArea) {
> 153:                 area =  textArea;

nit
Suggestion:

            area = textArea;

test/jdk/performance/client/SwingMark/src/AdvancedTextAreaTest.java line 169:

> 167:         @SuppressWarnings("deprecation")
> 168:         public TextFontSetter(JTextArea textArea) {
> 169:             area =  textArea;

nit
Suggestion:

            area = textArea;

test/jdk/performance/client/SwingMark/src/AdvancedTextAreaTest.java line 188:

> 186: 
> 187:         public TextPaster(JTextArea textArea) {
> 188:             area =  textArea;

Suggestion:

            area = textArea;

test/jdk/performance/client/SwingMark/src/AdvancedTextAreaTest.java line 203:

> 201: 
> 202:         public TextSelector(JTextArea textArea) {
> 203:             area =  textArea;

Suggestion:

            area = textArea;

test/jdk/performance/client/SwingMark/src/AdvancedTextAreaTest.java line 232:

> 230: 
> 231:         public CaretSetter(JTextArea textArea) {
> 232:             area =  textArea;

Suggestion:

            area = textArea;

test/jdk/performance/client/SwingMark/src/LabelTest.java line 114:

> 112: 
> 113:    public LabelChanger(JLabel[] labelsToChange) {
> 114:       labels =  labelsToChange;

nit
Suggestion:

      labels = labelsToChange;

test/jdk/performance/client/SwingMark/src/ListTest.java line 54:

> 52:         loadBundle();
> 53:         JPanel panel = new JPanel();
> 54:         String[] list1Data =  new String[list1ItemCount];

nit
Suggestion:

        String[] list1Data = new String[list1ItemCount];

test/jdk/performance/client/SwingMark/src/ListTest.java line 69:

> 67:      private void loadBundle() {
> 68:          ResourceBundle bundle = ResourceBundle.getBundle("resources.ListTest");
> 69:          DISPLAY_STRING =  bundle.getString("DisplayString");

Suggestion:

         DISPLAY_STRING = bundle.getString("DisplayString");

test/jdk/performance/client/SwingMark/src/ListTest.java line 116:

> 114: 
> 115:    public ListScroller(JList listToScroll, int scrollBy) {
> 116:       list =  listToScroll;

nit
Suggestion:

      list = listToScroll;

test/jdk/performance/client/SwingMark/src/NullRunnable.java line 38:

> 36:   */
> 37: 
> 38: class NullRunnable implements Runnable  {

nit
Suggestion:

class NullRunnable implements Runnable {

test/jdk/performance/client/SwingMark/src/SliderTest.java line 103:

> 101: 
> 102:     public SliderInc(JSlider sliderToIncrement, int incrementBy) {
> 103:         slider =  sliderToIncrement;

nit
Suggestion:

        slider = sliderToIncrement;

test/jdk/performance/client/SwingMark/src/TableColMoveTest.java line 94:

> 92: 
> 93:     public TableColMover(JTable table) {
> 94:         this.table =  table;

Suggestion:

        this.table = table;

test/jdk/performance/client/SwingMark/src/TableColTest.java line 87:

> 85:       System.out.println("1)Removing Columns");
> 86:       TableColAdder colRemover = new TableColAdder(currentTable,false);
> 87:       while(currentTable.getColumnCount() > 0 )  {

nit
Suggestion:

      while (currentTable.getColumnCount() > 0)  {

test/jdk/performance/client/SwingMark/src/TableColTest.java line 139:

> 137: 
> 138:     public TableColScroller(JTable tableToScroll, int scrollBy, int selectionMode) {
> 139:       table =  tableToScroll;

nit
Suggestion:

      table = tableToScroll;

test/jdk/performance/client/SwingMark/src/TableRowTest.java line 166:

> 164: 
> 165:     public TableScroller(JTable tableToScroll, int scrollBy, int selectionMode) {
> 166:         table =  tableToScroll;

nit
Suggestion:

        table = tableToScroll;

test/jdk/performance/client/SwingMark/src/TableRowTest.java line 213:

> 211: 
> 212:     public TableRowAdder(JTable table, Object[][] data, boolean add) {
> 213:         this.table =  table;

nit
Suggestion:

        this.table = table;

test/jdk/performance/client/SwingMark/src/TextAreaTest.java line 82:

> 80:    private void loadBundle() {
> 81:        ResourceBundle bundle = ResourceBundle.getBundle("resources.TextAreaTest");
> 82:        DISPLAY_STRING =  bundle.getString("DisplayString");

nit
Suggestion:

       DISPLAY_STRING = bundle.getString("DisplayString");

test/jdk/performance/client/SwingMark/src/TextAreaTest.java line 124:

> 122: 
> 123:     public TextAppender(JTextArea textArea, String appendThis) {
> 124:         area =  textArea;

nit
Suggestion:

        area = textArea;

test/jdk/performance/client/SwingMark/src/TextPaneTest.java line 102:

> 100: 
> 101:         public TextAppender(JTextPane textArea, String appendThis) {
> 102:             area =  textArea;

Suggestion:

            area = textArea;

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168371928
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168378903
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168379263
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168379998
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168380396
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168380595
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168380769
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168381097
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168370089
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168376898
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168377279
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168377716
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168378106
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168378392
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168381452
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168374848
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168375116
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168373171
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168373510
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168372480
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168372764
PR Review Comment: https://git.openjdk.org/jdk/pull/13486#discussion_r1168381757



More information about the client-libs-dev mailing list