Community
Participate
Working Groups
Build: Eclipse Scout 3.7.1 Description: While profiling an Eclipse Scout application with jvisualvm, we found that one of the time consuming operations when displaying large table data is the FontSpec.parse() method. It is mainly called by CellStyle.getFont() when creating the table cells. Steps to reproduce: - You will need a table page which potentially displays a large amount of data (in our specific tests we consider tables with > 20'000 rows as 'large') - Populate a table page with the data (i.e. through an unconstrained search) Reproducible: always Solution: Eliminate the FontSpec.parse() method from the getter method CellStyle.getFont(). The proposed solution (see attached patch file) does the following: - replace the internal font representation in CellStyle (replace the existing string representation m_fontPattern with a simple reference to a FontSpec object, m_fontSpec). The following has been considered: - Correctness: Occurrences of m_fontPattern in equals and hashCode methods can be safly replaced with m_fontSpec (because FontSpec overrides those methods as well) - Memory consumption: Memory consumption is not affected by this change (verified with jvisualvm) - Performance: performance is significantly improved when displaying large amount of data in table pages. In our tests we measured speed-ups of about 1/4 to 1/3 of the total time needed to display the data. - Shared access to FontSpec objects: the existing getter always created a new FontSpec object, the existing setter released the reference to the passed input paramter. This behavior could be simulated with defense copies of FontSpec objects stored and returned by the getter and setter methods. However, this is not necessary as a FontSpec object is effectivly immutable. To make this fact clear, I attached another patch file which makes FontSpec also technically immutable (make member fields final, remove empty constructor). Attached files: org.eclipse.scout.rt.client.ui.basic.cell.CellStyle.java.patch org.eclipse.scout.rt.shared.data.basic.FontSpec.java.patch
Created attachment 206666 [details] Patch CellStyle: replace m_fontPattern with m_fontSpec
Created attachment 206667 [details] Patch FontSpec: make FontSpec technically immutable
Lukas, thanks a lot for this fantastic bug report, analysis and fix! Reviewed and applied patches.
Bug fix should be applied on 3.7 branch as well.
Applied patch on 3.7 branch and changed target milestone to 3.7.2.
Thank you. Successfully tested on Scout branch 3.7.1. Also, did some quick tests on Scout trunk (3.8). Performance of displaying data in a table is improved by about a factor of 2. From our tests: Table with 33'000 rows: - fetching data from server ca. 12 sec - displaying data in GUI ca. 5 sec (before: ca. 10 sec) Table with 19'000 rows: - fetching data from server ca. 7 sec - displaying data in GUI ca. 3 sec (before: ca. 6 sec)
shipped with eclipse scout 3.7.2 (indigo sr2)