From: Bart B. <ba...@ho...> - 2001-02-16 22:10:01
|
No , this will not speed up things at all... doing: Class.prototype.method=3Dfunction(){ } OR function method(){ } Class.prototype.method=3Dmethod OR Class.prototype.method=3Dfunction 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 =3D=3D no noticable difference) -----Ursprungligt meddelande----- Fr=E5n: Jordi - IlMaestro - Ministral <jmi...@or...> Till: dyn...@li... = <dyn...@li...> Datum: den 16 februari 2001 14:23 =C4mne: 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 =3D function A >else DynLayer.prototype.moveTo =3D 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 (pb...@oi...) >> Software ontwikkelaar >> Oberon Informatiesystemen b.v. >> http://www.oibv.com >> >> > -----Oorspronkelijk bericht----- >> > Van: dyn...@li... >> > [mailto:dyn...@li...]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 >> Dyn...@li... >> http://lists.sourceforge.net/lists/listinfo/dynapi-dev > > >_______________________________________________ >Dynapi-Dev mailing list >Dyn...@li... >http://lists.sourceforge.net/lists/listinfo/dynapi-dev > |