| Summary: | Compress all JavaScript at runtime | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ralf Sternberg <rsternberg> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | b.muskalla, fr.appel, ruediger.herrmann, stephan.leichtvogt |
| Version: | 1.4 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | plan-version=1.5 plan-theme=development plan-status=proposed | ||
| Bug Depends on: | |||
| Bug Blocks: | 338647 | ||
|
Description
Ralf Sternberg
You should be careful with approaches like the closure compiler. The last time I checked it, it did the same thing as GWT - dead code elimination. Without a client-side protocol handler, this can be problematic as either the code that is called from the LCAs isn't there anymore or has another name. This would also enable us (in theory) to create browser- or application-specific client-code, decresing the size of javascript that needs to be transported and parsed. (In reply to comment #1) > You should be careful with approaches like the closure compiler. The last time I > checked it, it did the same thing as GWT - dead code elimination. Without a > client-side protocol handler, this can be problematic as either the code that is > called from the LCAs isn't there anymore or has another name. If this code elimination is not optional, it would of course disqualify the Closure Compiler. Even with a protocol handler this would exclude any custom widgets. But the YUI compressor seems to do a very good job (see bug 327451)! With the approval of CQ 4536, the subset needed from the YUI Compressor can now be checked into our CVS. YUI Compressor is in CVS. client.js is not needed anymore as YUI Compressor compresses the javascript files at runtime in "standard" mode. In "debug" mode the javascript files are delivered uncompressed. Does this change affect the startup time of RAP? We do the measurement before the actual integration and the results are the following - measurement is done in DisplayLCA#writeLibraries: 1. with client.js - average time of 10 measurements is 1948 ms 2. with YIU compression - average time of 10 measurements is 2314 ms We loose ~350ms from the startup time witch is about 15%. I did the measurements again with the current CVS HEAD - measurement is done in DisplayLCA#registerResources. The average time needed for QooxdooResourcesUtil.registerResources(); is 2250ms. I reverted the last changes as my last measurements of the startup time show different result than before. Is there anything we can do to make this a reality for 1.5? We have it in our list for M7. Compressing all JavaScript at runtime would delay the startup by roughly 2 seconds. While this is certainly acceptable at deployment time, it would further impede the development-deploy-test cycle. Therefore we agreed not to do this at the moment. I've opened bug 393496 to move the clientbuilder into the RAP repository. This will make it easier for others to re-built the client. |