Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360287

Summary: VE is extremely slow
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Huo Zhen Zhong <huozz>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: chenzhh, jinfahua, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Much faster rendering of the browser
lasher: iplog+
Much better refresh times lasher: iplog+

Description Justin Spadea CLA 2011-10-07 17:10:02 EDT
My investigations so far have shown two problem areas:

1. Generation of the working copy's .js file is very slow the second time it is done for an editor. The first time you go to the preview tab it's not terrible, but if you refresh it then it's significantly slower.

2. Once the HTML is generated and loaded in the browser, the render time is very slow (downloading all the .js, .css, .properties files, then initializing the UI).
Comment 1 Justin Spadea CLA 2011-10-07 17:36:52 EDT
Tony - I will attach patches for each of these issues. Please have someone apply them to their machine and run sniff tests on the VE to make sure nothing has been broken.
Comment 2 Justin Spadea CLA 2011-10-07 17:38:58 EDT
Created attachment 204779 [details]
Much faster rendering of the browser

The egl.handleIDEEvent(); call when egl_development.js gets loaded is causing lots of interfering "___getevent" requests. There is no need for these requests until all the files have been loaded. It has been moved out of egl_development.js and into the HTML generation (development-mode only).
Comment 3 Justin Spadea CLA 2011-10-07 17:44:40 EDT
Created attachment 204780 [details]
Much better refresh times

During a compile, the Egl2Mof code saves the new IR it creates at the beginning of the transformation in the environment's cache. However the PreviewIREnvironment was first checking if the contextStore had the IR. Starting with the second time a compile is run, this object store starts deserializing the IR from the previous compilation. Not only is this wrong, but it was killing performance. In my small handler, it was deserializing the previous IR 71 times. Yes, 71, that's not a typo.

I made PreviewIREnvironment extend ProjectIREnvironment in order to support caching object stores, and additional I made contextStore use a new type PreviewObjectStore - which is a FileSystemObjectStore with caching support (very similar to IFileSystemObjectStore). Now the previous IR is never deserialized when it's not supposed to be and my page refreshes in ~400ms instead of ~18000ms.
Comment 4 Tony Chen CLA 2011-10-08 01:31:00 EDT
I've verified the second patch, it fixed the cache problem and improved generation performance significantly. I did not understand why the previous IR was deserialized 71 times, I think that might be lookup for other IRs, not the one we are compiling. Anyway, the problem is fixed by the patch and it looks correct now. 

Forest will verify the problem & patch related to egl.handleIDEEvent()

Besides these two, there's another known issues related to VE performance as described in Bug 359355 - investigation of dynamic loading of VE
VE originally has a "dynamic loading" approach to improve performance during design, (NOT the same Dynamic Loading feature as we ship in RBD8012). This approach, however, is not working perfectly in EDT, which finally leads to a full refresh (reload HTML and everything) everything we reference some new widgets. Forest is looking at how to modify the approach so that it work with EDT.
Comment 5 Huo Zhen Zhong CLA 2011-10-08 02:06:53 EDT
I've verified the first patch, it works well and does not break other things. I only test on windows, but as Justin is the reporter and fix maker of the bug, I think he has tested the performance on Linux. Justin, let me know if you need me to also test on Linux. Thanks
Comment 6 Justin Spadea CLA 2011-11-01 11:25:01 EDT
Verified