The argument isn't so much space or time, at least not time on a single runtime. What made me decide to do this was the worry that various runtimes might not implement string ops as efficiently as Flash does. Basically, Flash's fast string concat is making it possible for you to consolidate the two routines -- the maintenance improvement is bought with a specific runtime feature. That makes me mildly uncomfortable as we move to multiple runtimes, especially since these routines are hot spots in almost every Laszlo app I've profiled.
Since hash lookup ought to be cheap on any reasonable JS runtime, I could back off to consolidated routines that look up symbols in a hash, rather than completely split routines. This would be for setWidth/setHeight, __LZcheckwidth/__LZcheckheight, and updateWidth/ updateHeight. jim On Apr 4, 2006, at 9:24 AM, P T Withington wrote: > Then we nee macros! > > On 2006-04-04 12:17 EDT, Adam Wolff wrote: > >> The reason these methods worked this way was not to save space, >> but for >> maintenance. Of course, these methods used flasm then (I think) so >> maintaining two versions was not an option. >> >> This code is fairly complex, so I'd be concerned that someone >> would fix a >> bug in one and not the other. >> >> A >> >> On Mar 31, Jim Grandy wrote: >> >>> Change 41085 by [EMAIL PROTECTED] on 2006/03/31 14:34:00 *pending* >>> >>> Summary:Remove string-parametric property access from width/height >>> dependent >>> methods in LzView >>> Technical Reviewer: ptw (pending) >>> QA Reviewer: mdavis (pending) >>> Doc Reviewer: >>> Details:Rewrite methods to be width- or height-dependent >>> instead of using >>> string concatenation to compose property names on the fly. LFC7.lzl >>> size >>> changes by 834 bytes as a result of this change. >>> Tests:runlzunit, laszlo-explorer >>> >>> Affected files ... >>> >>> ... //depot/lps-dev/WEB-INF/lps/lfc/views/LaszloView.as#39 edit >>> >>> > _______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
