On 2006-03-29 21:45 EST, Benjamin Shine wrote:

> 40% less overhead -- cool!
>
> Would it speed things up to go farther along this trajectory, and  
> implement updateWidth and updateHeight methods, with hardly any  
> conditionals?
>
> Tucker, which is preferable:
> foo[ 'bar' ] = 27;
> or
> foo.bar = 27;

These are completely equivalent.  (Caveat: in .lzs in debug mode []  
is not checked for non-existent property.  In .js, it is not an error  
to reference a non-existent property, but our developers find it  
useful to be warned in that case.  We don't warn for [] to give  
developers an easy way to silence the warning.  Not really the best  
approach.  There should be a #pragma for this.

> How about
> var baz = 'bar';
> foo[ baz ] = 27;
> versus
> foo.bar = 27;

One more instruction in the var case to dereference the var.

But as I mentioned in my review comments to Jim, I suspect the real  
savings he created comes from avoiding the unnecessary function calls.

> In the "teach ben to fish" mode, how can I figure out relative  
> performance of stuff like this?
>
> On Mar 29, 2006, at 4:18 PM, Jim Grandy wrote:
>
>> Change 41001 by [EMAIL PROTECTED] on 2006/03/29 16:12:40 *pending*
>>
>>         Summary:Optimize LzView.updateSize
>>
>>         Technical Reviewer: ptw (pending)
>>         QA Reviewer: mdavis (pending)
>>         Doc Reviewer:
>>
>>         Details:Reduce string concat overhead and only send events  
>> if they are
>>         non-null. Profiler tells me these changes reduce overhead of
>>         LzView.updateSize by about 40%.
>>
>>         Tests:smokecheck.lzx
>>
>> Affected files ...
>>
>> ... //depot/lps-dev/WEB-INF/lps/lfc/views/LaszloView.as#38 edit
>>
>> <changeset-41001.zip>
>> _______________________________________________
>> Laszlo-dev mailing list
>> [email protected]
>> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>
> benjamin shine
> software engineer
> [EMAIL PROTECTED]
>
>
>

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to