Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362459 - Run JavaScriptGen only at deployment
Summary: Run JavaScriptGen only at deployment
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: pf yu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-31 05:34 EDT by Tony Chen CLA
Modified: 2017-02-23 14:15 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chen CLA 2011-10-31 05:34:28 EDT
We are running both JSGenerator and DevJSGenerator whenever generation is needed for client code. However, the output of JSGenerator is not used until we deploy the application. While developer uses VE design, preview, external browser, or debug a handler, we always uses the output of DevJSGenerator. Given this, we should consider to run the JSGenerator when user deploy the application. This could save 50% of JS generation time.
Comment 1 Tony Chen CLA 2011-10-31 06:00:16 EDT
I updated compiler preference file manually to remove JSGenerator, and only keep DevJSGenerator. Then tested by building a rui + service + database application from beginning. Things seemed to be working fine in VE and debugger. There's one time I see some dojo not defined error when debug this application, but it does not appear again when I retried it.
Comment 2 Brian Svihovec CLA 2011-10-31 09:28:06 EDT
Tony,

I agree that disabling the JS Deploy Generator should not have an affect on the development of Rich UI applications, but this would only be a realistic change if we could figure out how to incrementally generate the parts being deployed.  I believe we discussed this in the past, and could not come up with an easy solution, but maybe things have changed since then.  

To be specific, when a Handler is deployed, only the parts that have been changed since the last deployment should be generated, and not all of the parts being deployed.  Assuming we can locate the IRs of all of the parts being deployed, and the previously generated content for each of those IRs, I am guessing that we could check the time stamps on the files to see what needs to be regenerated.  

In general, this feels like something we should investigate after .7 is delivered.  Along with the issues described above, there might be issues with synchronizing the generation and the deployment of the .js files, etc.  I think it would be better to look into our constant downloading of multiple runtime .js files in the VE before looking into this issue. 

One thing that might be worth looking into for .7 is to verify that the WorkingCopyGeneration that occurs for the VE is only running the Development generator.
Comment 3 Tony Chen CLA 2011-11-02 02:10:36 EDT
Brian, incrementally generate the parts being deployed seems to be a difficult thing, we could not leverage eclipse in this scenario. 

The other options to think might be
a. Re-gen everything at deploymen. This certainly makes deployment much slower. However, it is a tradeoff between dev performance and deploy performance. If in the real world, users are in dev mode 95% of their time, then a few minutes deployment might be acceptable. 
b. On top of solution a, make our widgets project configured with both JSGen & DevJSGen so that widgets don't need to be re-gen at deployment time. Make any user created project configured with DevJSGen on, and we will take care of generating the runtime JS during deployment. 

after all, I'm with you that this discussion can be deferred after 0.7. 

I have checked WorkingCopyGenerationOperation, it is using devJSGen only.
Comment 4 Justin Spadea CLA 2011-11-02 09:04:37 EDT
One thing to think about post-0.7: At deploy time we already have a list of all the dependent IRs for the current handler. For each dependent IR we could look up the corresponding .egl file and check its timestamp vs the timestamp of the generated file (we already have a way to get the generated file's path). If the generated file doesn't exist, or it's older than the .egl file, then generate it.

This would cause files to only be generated when they're needed for deployment, without the overhead of always generating everything.
Comment 5 Tony Chen CLA 2012-01-05 04:04:12 EST
With the performance enhancement in IR Visitor and bug fixes in IDE core (which prevent unnecessarily rebuilds), generation performance does not seem to be a big problem now. 

Considering the complexity and small benefit of this enhancement, we may want lower the priority and defer this.
Comment 6 Brian Svihovec CLA 2012-01-06 15:03:21 EST
I agree with Tony.  We can make this a higher priority if we find that it becomes a bottle neck.