| Date | Description |
| 16 May 2007 | Team formed |
A large memory consumption issue was discovered due to the allocation of TagLibraryInfoImpl datastructures for each page (approximately 2 to 3 meg). TagLibraryInfoImpl datastructure is created by the JSP parser and is stored in the NbEditorDocument for the JSP files.
First pass performance results (after implementing Task 1 & 2 below)
| Action | With out Fix | With Fix |
| Create VWP project (new User dir) | 30-35 secs (designer to appear) | 25-30 secs (designer to appear) |
| Create second VWP project | 6-10 secs (designer to appear) | 6-10 secs (designer to appear) |
| Open first blank page of a project with 1 page (after IDE start) | 6-8 secs | 6-8 secs |
| Open first page (lots of components) of a project with 1 page (after IDE start) | 13-15 secs | 13 - 15 secs |
| Opening first page (blank) of a project with 128 pages (after IDE start) | 2 min 5-10 secs (memory + 30-40 MB) | 6-8 secs (memory +10-15 MB) |
| Opening first page (lots of components) of a project with 128 pages (after IDE start) | 2 min 30-40 secs (memory + 100-120 MB) | 12 - 15 secs (memory +15-20 MB) |
Results after eliminating the call to syncAll()(as per Observation 4) and optimizing findDesignContexts() implementation
| Action | With out Fix | After removing syncAll() calls | After removing syncAll() calls and optimizing findDesignContexts() |
| Adding table component (I time) for a project with 1 page | 6 secs | 6.3 secs | 6.3 secs |
| Adding table component (II time)for a project with 1 page | 1.8 secs | 2 secs | 1.6 secs |
| Adding table component (I time) for a project with 128 pages | 140 secs | 18 secs | 7.5 secs |
| Adding table component (II time)for a project with 128 pages | 2.8 secs | 7 secs | 2.8 secs |
| # | Description |
| 1 | IDEA:Generate managed bean crossreference accessors only at the time of creation of the Lifecycle managed beans i.e. AbstarctPageBean, AbstarctRequestBean, AbstarctSessionBean, AbstarctApplicationBean sub classes. |
Many users have been complaining about this. Therefore it has been decided to generate them only when the life cycle managed beans are created
| 2 | IDEA:Investigate if it will be possible to avoid initial call to syncAll() which modes all the Lifecycle managed beans |
TODO: Ensure that syncAll() is not called from some other places
| 3 | OBSERVATION: The measurements are showing that NdEditorDocument for a blank VW page (.jsp) are 3M as opposed to 8K for simple JSF page. Investigate. |
Issue # 105427 has been filed.
| 4 | OBSERVATION: Measurements show that Table component takes too long to appear on the designer when dropped first time after opening the project |
Investigation results based on Jprofiler profiling data:
| Action | Project with one Page | Project with 128 pages | Project with one page (With "fix") | project with 128 pages (With "fix") |
| First time drop | 9-10 secs | 70-80 secs | 4-5 secs | 4-5 secs |
| Second time drop | 3-4 secs | 3-4 secs | 3-4 secs | 3-4 secs |
First time drop lag is mostly influenced by insync and partially by designer (see attachment Table_first_drop_call_tree1.html
).
The second time drop lag is mostly influenced by designer and partially by (see attachment Table_second_drop_call_tree2.html
)
Interestingly if you notice, when the table is dropped for the first time on a page with 128 pages (just one page opened), it takes about 70-80 secs. It turns out, when the table is dropped, the dreaded syncAll() is called at two places (See Table_first_drop_call_tree1.html
& Table_second_drop_call_tree2.html
).
When I commented out the code where getDesignContext() is executed (which in turn calls the syncAll()), the so called "fix" I mentioned in the table (not a real fix, could potentially break other actions like refactoring), the table drop took only about 4-5 secs on both single and 128 page projects.
We need to carefully evaluate the need for getDesignContexts() at org.netbeans.modules.visualweb.insync.live.BeansDesignProperty.toSource() and org.netbeans.modules.visualweb.insync.beans.Bean.setName() to avoid the above performance issue.
On Friday, Jun 1st 2007, Deva created a patch for replacing the use of getDesignContexts() in the above two places. We reviewed the patch on Mon, Jun 05, 2007. It looks good with minor corrections such as use of contsants in place of string literals.
If the above is "corrected", now most of the performance lag is due to designer.
The main culprit seems to be org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap. (see attachment Table_second_drop_call_tree2.html
). For every property change in the component the StyleMap is recomputed by batik parser which is the main performance bottle neck. We need to find out if any caching could be done.
The problem is really pronounced when you have many components in the page.
We need to take a look at the code at Batik parser and see what we can do here. Batik code is a hacked version so you can change it if we want. Also need to see if these things are fixed in new version of open source batik parser and check the possibility of merging with our hacked version.
| 5 | OBSERVATION: Insync uses several Retouche modification tasks and commits the modifications after each task. There may be a possibility of caching the modifications starting at writeLock() and commiting them in writeUnlock(). This may improve performance. |
Deva is investigating the feasibility of the above approach. Deva please add your observations.
| 6 | OBSERVATION: When a complex page is loaded in to the designer, it becomes very cumbersome to design the page. |
While moving around the components or modifying the component properties in a page with complex layouts and compoents it takes several second for the designer to repaint. Designer freezes for several seconds
On a fast machine it takes about 7-10 seconds for designer refresh. On a slow end machine, it takes about 30-40 seconds on a very complex page.
We analyzed the performance using The main culprit seems to be org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap. (see attachments Designer_painting_Call_Tree.html
& Designer_painting_Hot_Spots.html
).
For every property change in the component the StyleMap is recomputed by batik
parser which is the main performance bottle neck.
Even when one property changes, other computed properties in the parents and children (inheritance + cascading) might change. so most of the things get recomputed after that. Need more analysis to find if there is a way not to do page layout when modifications made to properties which does not influence the layout at all (e.g renaming the id) or doing a binding that does not change the visual at all.
Issue # 106724 has been filed
(Legend: P - CPU performance, ML - Memory Leak, MC - Memory consumption, OMO - one time memory overhead - such as factories in lookup?)
We will initially concentrate on the following simple scenarios - 1,2,3,4.
The nb-perf@sun.com mailing list will be used for communications.
| Designer_painting_Call_Tree.html | ![]() |
892008 bytes |
| Designer_painting_Hot_Spots.html | ![]() |
409256 bytes |
| Table_first_drop_call_tree1.html | ![]() |
261554 bytes |
| Table_first_drop_call_tree2.html | ![]() |
106036 bytes |
| Table_second_drop_call_tree.html | ![]() |
233023 bytes |