Thread contention because of unnecessary java.util.logger calls [Vaadin 7]

Hi,

In my application I see lots of thread contention because there are high volume calls to java.util.logger framework using Class.getSimpleName():

INFO   | jvm 1    | 2018/09/19 12:27:41 | "Worker-33" #1726242 prio=5 os_prio=0 tid=0x000000009c0b4000 nid=0x5c30 runnable [0x00000000c4e7d000]

INFO   | jvm 1    | 2018/09/19 12:27:41 |    java.lang.Thread.State: RUNNABLE
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at java.lang.Class.getEnclosingMethod0(Native Method)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at java.lang.Class.getEnclosingMethodInfo(Class.java:1072)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at java.lang.Class.getEnclosingClass(Class.java:1272)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at java.lang.Class.getSimpleBinaryName(Class.java:1443)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at java.lang.Class.getSimpleName(Class.java:1309)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.ui.Table.registerComponent(Table.java:2431)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.ui.Table.parseItemIdToCells(Table.java:2423)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.ui.Table.getVisibleCellsNoCache(Table.java:2232)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1747)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.ui.Table.refreshRowCache(Table.java:2694)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.ui.Table.containerItemSetChange(Table.java:4585)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.data.util.AbstractContainer.fireItemSetChange(AbstractContainer.java:246)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.data.util.AbstractInMemoryContainer.fireItemsAdded(AbstractInMemoryContainer.java:1004)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.data.util.AbstractInMemoryContainer.fireItemAdded(AbstractInMemoryContainer.java:986)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.data.util.IndexedContainer.fireItemAdded(IndexedContainer.java:569)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.data.util.IndexedContainer.addItem(IndexedContainer.java:251)
INFO   | jvm 1    | 2018/09/19 12:27:41 | 	at com.vaadin.data.util.IndexedContainer.addItem(IndexedContainer.java:238)

This is the corresponding source code:

        getLogger().log(Level.FINEST, "Registered {0}: {1}", new Object[] {
                component.getClass().getSimpleName(), component.getCaption() });

As you know, Class.getSimpleName() is not really a cheap call, and the underlying log pattern does not check if the log is even enabled.

  1. Question: Is the logging fixed/done differently in higher versions? Currently using Vaadin 7.7.9. If not, how to get this fixed?
  2. Question: Why does the table have to call refreshRowCache everytime you add an element?

Thank you.