No , this will not speed up things at all...
doing:
Class.prototype.method=function(){ }
OR
function method(){ }
Class.prototype.method=method
OR
Class.prototype.method=function method() { }
is essentially the same speed wise.
What you are doing is assigning a reference to a function in either case. Whether it
has a name or exists previously or not is unimportant.
It is still a reference.
(oh.. and I tested this just to be sure... did an avarage of about 10000 calls == no
noticable difference)
-----Ursprungligt meddelande-----
Från: Jordi - IlMaestro - Ministral <[EMAIL PROTECTED]>
Till: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Datum: den 16 februari 2001 14:23
Ämne: Re: [Dynapi-Dev] TCanvas vs. DynLayer
>Speed optimization can always be introduced. In fact, the latest precreation
>code that caused some old bugs to reappear and some people to complain about the
>API going backwards was introduced in order to speed up layer creation,
>something that was not a problem until people started wanting hundreds, even
>thousands of layers onscreen.
>
>I've been tempted to suggest this many times but I didn't want to spawn another
>"code split-up" argument. Some critical methods like, say, moveTo or setSize
>might speed up by doing.:
>
>if(is.ns) DynLayer.prototype.moveTo = function A
>else DynLayer.prototype.moveTo = function B
>
>I'll try myself in see what happens
>
>Pascal wrote:
>
>> me again :)
>>
>> I don't think this test is really useable.
>> Your current Tcanvas code misses ALOT of things DynLayer takes care of.
>>
>> DynLayer sets sizes, z-index,clipping,bgimages in initialisation (and also a
>> few other style properties.. note that setting a style property is what
>> slows everything down) I once did some optimization tricks to the dynlayer,
>> by removing sizes/clipping etc.. this speeds up things BIG TIME, but also
>> brakes useability for a large amount of widgets, and is less flexible.
>>
>> DynLayer has code included for fast child-creation.. even though there are
>> no child layers in your test, this code is still called (function calls).
>> This could be made faster in dynlayer, but for now is more readable for
>> developers. Do another test with layers containing a large amount child
>> layers.. Dynlayer's precreation will probably be faster.
>>
>> shreded enough? ;)
>>
>> Pascal Bestebroer ([EMAIL PROTECTED])
>> Software ontwikkelaar
>> Oberon Informatiesystemen b.v.
>> http://www.oibv.com
>>
>> > -----Oorspronkelijk bericht-----
>> > Van: [EMAIL PROTECTED]
>> > [mailto:[EMAIL PROTECTED]]Namens Eytan
>> > Heidingsfeld
>> > Verzonden: vrijdag 16 februari 2001 13:19
>> > Aan: Dynapi-Dev
>> > Onderwerp: [Dynapi-Dev] TCanvas vs. DynLayer
>> >
>> >
>> > I'd love to test performance one against the other. The only
>> > test I did was
>> > create 100 layers and check the times. In IE TCanvas was 200
>> > ms faster and
>> > in NS it was 1300(canvas) to 10000(dynlayer).
>> >
>> > I'd love you guys to start tearing my canvas to shreds.
>> >
>> > Included in the zip are:
>> > tcanvas.js
>> > browser.js
>> >
>> > they need to be included in the document(working on adding .include)
>> >
>> > 8an
>> >
>>
>> _______________________________________________
>> Dynapi-Dev mailing list
>> [EMAIL PROTECTED]
>> http://lists.sourceforge.net/lists/listinfo/dynapi-dev
>
>
>_______________________________________________
>Dynapi-Dev mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/dynapi-dev
>
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev