[Laszlo-dev] [UPDATED] For Review: Change 20070827-maxcarlson-0 Summary: Inline setAttribute

Max Carlson max at openlaszlo.org
Wed Aug 29 12:16:55 PDT 2007


P T Withington wrote:
> So, you no longer want to restrict this optimization to the LFC?

No, this optimization is restricted to the LFC.  Sorry, the change notes 
should have reflected that.

> I'm a little leery of the change to use a counter for the UUIDs.  That 
> seems risky.

I'll change it back.  A counter seemed less risky to me, because a 
unique ID is always guaranteed.  A random number generator has a tiny 
risk of causing collisions.

In any case, Don's work will take care of the long UUIDs.

> The alternative is to wait for Don's work to refactor the compiler so 
> this transformation comes before the analyzer phase that rewrites all 
> locals compactly.
> 
> Bottom line:  Check this in if you believe the performance improvement 
> is worth it.

I think it is, for the LFC only.  Animators will benefit in particular.

> On 2007-08-27, at 19:42 EDT, Max Carlson wrote:
> 
>> Change 20070827-maxcarlson-0 by maxcarlson at plastik on 2007-08-27 
>> 16:33:13 PDT
>>     in /Users/maxcarlson/openlaszlo/wafflecone
>>     for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
>>
>> Summary: Inline setAttribute
>>
>> Bugs Fixed:
>> LPP-4513 'Compiler Improvements to address performance'
>>
>> Technical Reviewer: ptw, max
>> QA Reviewer: henry
>> Doc Reviewer: (pending)
>>
>> Details:
>>     CodeGenerator.java, JavascriptGenerator.java - Inline calls to
>>     setAttribute() when called as the script compiler, unless #pragma
>>     "passThrough=true".  UUID generator uses integer counter to cut 
>> down on
>>     size.
>>
>>     LzContextMenu.js, LzTextSprite.js, LzInputTextSprite.js,
>>     embednew.js, iframemanager.js - Call Lz.__setAttr() instead of
>>     div.setAttribute(...).  Add __setAttr() method to be used so
>>     div.setAttribute() isn't inlined.
>>
>> Tests:
>>     All demos run as before (but faster in swf and dhtml).  smokecheck
>>     also runs and passes now.
>>     http://localhost:8080/wafflecone/my-apps/copy-of-hello.lzx is 62k
>>     compressed in dhtml (was 60k), 92k compressed in swf7 (was 89k) and
>>     93k compressed in swf8 (was 90k).  This change will benefit animators
>>     and alignment constraints now.  We can always manually 
>> inline/optimize to
>>     bring the size down later.  I recommend taking this for now.
>>
>> Files:
>> M      WEB-INF/lps/lfc/kernel/dhtml/LzContextMenu.js
>> M      WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
>> M      WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
>> M      lps/includes/source/embednew.js
>> M      lps/includes/source/iframemanager.js
>>
>> Changeset: 
>> http://svn.openlaszlo.org/openlaszlo/patches/20070827-maxcarlson-0.tar
> 

-- 
Regards,
Max Carlson
OpenLaszlo.org


More information about the Laszlo-dev mailing list