[Laszlo-dev] [Laszlo-checkins] r5910 - in openlaszlo/branches/wafflecone/WEB-INF/lps/lfc: core events services
P T Withington
ptw at openlaszlo.org
Fri Aug 3 03:21:58 PDT 2007
You drive a hard bargain. Ok. I am convinced.
On 2007-08-03, at 02:54 EDT, Max Carlson wrote:
> It's an undocumented API that's only used by the LFC. We don't
> want folks overriding constructWithArgs() or using it. Given the
> comment above the declaration in LzNode (@todo 2006-05-24 ptw Adam
> says this is a hack that we should get rid of.) I'm okay with this
> change.
>
> If you still think otherwise I'll put it back in :)
>
> P T Withington wrote:
>> Well I still feel you cannot just eliminate an interface without
>> first deprecating it. Is there any reason not to use the solution
>> I proposed?
>> On Aug 2, 2007, at 9:45 PM, Max Carlson <max at openlaszlo.org> wrote:
>>> I grepped the entire source tree (with diamond) and didn't find
>>> any calls to super.constructWithArgs(). The only declaration is
>>> in WEB-INF/lps/lfc/data/LzReplicationManager.lzs:
>>>
>>> /**
>>> * @access private
>>> */
>>> function constructWithArgs ( args ){
>>> this.__LZHandleMultiNodes( this.initialnodes );
>>> delete this.initialnodes;
>>> if ( this.visible == false ){
>>> this.setVisible( false );
>>> }
>>> }
>>>
>>> P T Withington wrote:
>>>> I'm concerned about the change to constructWithArgs. Since this
>>>> is a defined method, there could be overrides out there that
>>>> will attempt to call super from their method -- that will bomb
>>>> now. If you want to avoid this call, then you could say:
>>>> if (this.constructWithArgs !==
>>>> LzNode.prototype.constructWithArgs) {
>>>> this.constructWithArgs(parent, args);
>>>> }
>>>> and not remove the default method.
>>>> On 2007-08-02, at 13:18 EDT, max at openlaszlo.org wrote:
>>>>> Author: max
>>>>> Date: 2007-08-02 10:18:46 -0700 (Thu, 02 Aug 2007)
>>>>> New Revision: 5910
>>>>>
>>>>> Modified:
>>>>> openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
>>>>> openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/events/
>>>>> LaszloEvents.lzs
>>>>> openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/
>>>>> LzCSSStyle.js
>>>>> Log:
>>>>> 20070801-maxcarlson-V by maxcarlson at plastik on 2007-08-01
>>>>> 20:51:00 PDT
>>>>> in /Users/maxcarlson/openlaszlo/wafflecone
>>>>> for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
>>>>>
>>>>> Summary: More optimization of LFC
>>>>>
>>>>> New Features:
>>>>>
>>>>> Bugs Fixed: LPP-4414 - Improve startup performance (partial)
>>>>>
>>>>> Technical Reviewer: promanik
>>>>> QA Reviewer: ben
>>>>> Doc Reviewer: (pending)
>>>>>
>>>>> Documentation:
>>>>>
>>>>> Release Notes:
>>>>>
>>>>> Details: LzCSSStyle.js - Cache getPropertyValueFor() calls.
>>>>> Only call _selectorApplies() for compound css statements.
>>>>>
>>>>> LzNode.lzs - Only call constructWithArgs() if it exists.
>>>>>
>>>>> LaszloEvents.lzs - Check for null reference.
>>>>>
>>>>>
>>>>> Tests: ...silver/main.lzx?lzr=dhtml&lzt=html shows ~24029 fewer
>>>>> total calls (252524 total before, 228495 now). http://
>>>>> localhost:8080/wafflecone/test/style/constraints/main.lzx?
>>>>> lzr=swf8 passes as before, shows 405ms for lookup test.
>>>>>
>>>>>
>>>>>
>>>>> Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/
>>>>> LzNode.lzs
>>>>> ==================================================================
>>>>> =
>>>>> --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/
>>>>> LzNode.lzs 2007-08-02 16:46:55 UTC (rev 5909)
>>>>> +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/
>>>>> LzNode.lzs 2007-08-02 17:18:46 UTC (rev 5910)
>>>>> @@ -180,7 +180,11 @@
>>>>> this.__LZstyleConstraints = this.__LZapplyStyleMap
>>>>> ( styleMap, attrs );
>>>>> }
>>>>>
>>>>> - this.constructWithArgs( maskedargs );
>>>>> + /**
>>>>> + * @todo 2006-05-24 ptw Adam says this is a hack that
>>>>> we should get
>>>>> + * rid of.
>>>>> + */
>>>>> + if (this.constructWithArgs) this.constructWithArgs
>>>>> ( maskedargs );
>>>>>
>>>>> delete this.__LZdeferDelegates;
>>>>> if (qpos != LzDelegate.__LZdelegatesQueue.length) {
>>>>> @@ -641,13 +645,6 @@
>>>>> }
>>>>>
>>>>> /**
>>>>> - * @access private
>>>>> - * @todo 2006-05-24 ptw Adam says this is a hack that we
>>>>> should get
>>>>> - * rid of.
>>>>> - */
>>>>> -function constructWithArgs ( parent , args ){}
>>>>> -
>>>>> -/**
>>>>> * Called at the same time that the node sends its oninit
>>>>> event -- usually
>>>>> * when the node's siblings are instantiated, and always after
>>>>> the node's
>>>>> * children are instantiated.
>>>>> @@ -1967,10 +1964,4 @@
>>>>> this.makeChild( dpobj , true);
>>>>> }
>>>>>
>>>>> -
>>>>> -/**
>>>>> - * @access private
>>>>> - */
>>>>> -function constructWithArgs ( parent , args ){}
>>>>> -
>>>>> } // End of LzNode
>>>>>
>>>>> Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/events/
>>>>> LaszloEvents.lzs
>>>>> ==================================================================
>>>>> =
>>>>> --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/events/
>>>>> LaszloEvents.lzs 2007-08-02 16:46:55 UTC (rev 5909)
>>>>> +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/events/
>>>>> LaszloEvents.lzs 2007-08-02 17:18:46 UTC (rev 5910)
>>>>> @@ -215,7 +215,7 @@
>>>>> }
>>>>> */
>>>>> // d.execute( sd ); inlined
>>>>> - d.c[d.f]( sd );
>>>>> + if (d.c[d.f]) d.c[d.f]( sd );
>>>>> i+=2;
>>>>> }
>>>>> evq.length = pos;
>>>>>
>>>>> Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/
>>>>> services/LzCSSStyle.js
>>>>> ==================================================================
>>>>> =
>>>>> --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/
>>>>> LzCSSStyle.js 2007-08-02 16:46:55 UTC (rev 5909)
>>>>> +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/
>>>>> LzCSSStyle.js 2007-08-02 17:18:46 UTC (rev 5910)
>>>>> @@ -70,6 +70,7 @@
>>>>> return 1 ;
>>>>> }
>>>>>
>>>>> +LzCSSStyleRule.prototype.__pvcache = {};
>>>>>
>>>>> var LzCSSStyle = {};
>>>>>
>>>>> @@ -90,6 +91,8 @@
>>>>> //var t = getTimer();
>>>>> if (!node) return;
>>>>> var uid = node.getUID();
>>>>> + var val = LzCSSStyleRule.prototype.__pvcache[uid + pname];
>>>>> + if (val) return val;
>>>>> var rules = this.__LZRuleCache[ uid ];
>>>>> if ( !rules ) {
>>>>> rules = new Array();
>>>>> @@ -102,7 +105,7 @@
>>>>> (rp.type == 3 && (((rp.classname in lz) &&
>>>>> (node instanceof lz[ rp.classname ])) || ( (rp.classname in
>>>>> global) && (node instanceof global[ rp.classname ])))) ||
>>>>> (rp.type == 5 && node[ rp.attrname ] ==
>>>>> rp.attrvalue) ||
>>>>> (rp.type == 6 && node[ rp.attrname ] ==
>>>>> rp.attrvalue && (((rp.classname in lz) && (node instanceof lz
>>>>> [ rp.classname ])) || ( (rp.classname in global) && (node
>>>>> instanceof global[ rp.classname ])))) ||
>>>>> - this._selectorApplies( r, rp, node ) ){
>>>>> + (rp.type == 4 && this._selectorApplies( r,
>>>>> rp, node ))){
>>>>> rules.push(r);
>>>>> }
>>>>> }
>>>>> @@ -124,7 +127,7 @@
>>>>> (rp.type == 3 && (((rp.classname in lz) &&
>>>>> (node instanceof lz[ rp.classname ])) || ( (rp.classname in
>>>>> global) && (node instanceof global[ rp.classname ])))) ||
>>>>> (rp.type == 5 && node[ rp.attrname ] ==
>>>>> rp.attrvalue) ||
>>>>> (rp.type == 6 && node[ rp.attrname ] ==
>>>>> rp.attrvalue && (((rp.classname in lz) && (node instanceof lz
>>>>> [ rp.classname ])) || ( (rp.classname in global) && (node
>>>>> instanceof global[ rp.classname ])))) ||
>>>>> - this._selectorApplies( r, rp, node ) ){
>>>>> + (rp.type == 4 && this._selectorApplies( r,
>>>>> rp, node ))){
>>>>> rules.push(r);
>>>>> }
>>>>> }
>>>>> @@ -148,7 +151,11 @@
>>>>> var i = 0;
>>>>> while ( i < l ) {
>>>>> var props = rules[i++].properties;
>>>>> - if (pname in props) { return props[pname]; }
>>>>> + if (pname in props) {
>>>>> + var v = props[pname];
>>>>> + LzCSSStyleRule.prototype.__pvcache[uid + pname] = v
>>>>> + return v;
>>>>> + }
>>>>> }
>>>>>
>>>>> ////this.time1 += getTimer() - t;
>>>>> @@ -316,7 +323,7 @@
>>>>> (inrp.type == 3 &&
>>>>> (((inrp.classname in lz) && (icurnode instanceof lz
>>>>> [ inrp.classname ])) || ( (inrp.classname in global) &&
>>>>> (icurnode instanceof global[ inrp.classname ])))) ||
>>>>> (inrp.type == 5 && icurnode
>>>>> [ inrp.attrname ] == inrp.attrvalue) ||
>>>>> (inrp.type == 6 && icurnode
>>>>> [ inrp.attrname ] == inrp.attrvalue && (((inrp.classname in lz)
>>>>> && (icurnode instanceof lz[ inrp.classname ])) ||
>>>>> ( (inrp.classname in global) && (icurnode instanceof global
>>>>> [ inrp.classname ])))) ||
>>>>> - this._selectorApplies( rule,
>>>>> inrp, icurnode )){
>>>>> + (inrp.type == 4 &&
>>>>> this._selectorApplies( rule, inrp, icurnode ))){
>>>>> if ( sindex-- == 0 ){
>>>>> iresult = true;
>>>>> break;
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Laszlo-checkins mailing list
>>>>> Laszlo-checkins at openlaszlo.org
>>>>> http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins
>>>
>>> --
>>> Regards,
>>> Max Carlson
>>> OpenLaszlo.org
>
> --
> Regards,
> Max Carlson
> OpenLaszlo.org
More information about the Laszlo-dev
mailing list