From: Jeff G. <je...@we...> - 2001-02-23 18:56:29
|
Hey guys... With all the discussion lately about optimizing the DynAPI2, I thought I'd finally get started on a project I have been meaning to get to lately and which I hope will benefit everyone developing the api. My new site (still under construction) is a collection of JavaScript optimization tips, techniques, tests and explanations. It will deal with speed, size and memory issues. Right now, I only have the speed section "done", but I am now working on the others. I put done in quotes because I hope the information will grow from your suggestions and comments. This is the link: http://home.earthlink.net/~kendrasg/info/js_opt/ There are a few things that aren't 100% yet, like the status messages for the tests on IE don't work right, but I will fix that soon. Anyway, let me know what you think. Jeff Greenberg je...@we... |
From: Pascal B. <pa...@dy...> - 2001-02-23 19:26:47
|
totally amazing stuff! you hit straight into my bookmarks with this site :) I'll be taking some things into account when optimising the dynlayer code! Pascal Bestebroer pa...@dy... http://www.dynamic-core.net > -----Oorspronkelijk bericht----- > Van: dyn...@li... > [mailto:dyn...@li...]Namens Jeff Greenberg > Verzonden: vrijdag 23 februari 2001 19:57 > Aan: dyn...@li... > Onderwerp: [Dynapi-Dev] My JS Optimization Site > > > Hey guys... > > With all the discussion lately about optimizing the DynAPI2, I thought > I'd finally get started on a project I have been meaning to get to > lately and which I hope will benefit everyone developing the api. > > My new site (still under construction) is a collection of JavaScript > optimization tips, techniques, tests and explanations. It will deal with > speed, size and memory issues. > > Right now, I only have the speed section "done", but I am now working on > the others. I put done in quotes because I hope the information will > grow from your suggestions and comments. > > This is the link: > > http://home.earthlink.net/~kendrasg/info/js_opt/ > > There are a few things that aren't 100% yet, like the status messages > for the tests on IE don't work right, but I will fix that soon. > > Anyway, let me know what you think. > > Jeff Greenberg > je...@we... > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > |
From: Jeff G. <je...@we...> - 2001-02-23 19:34:30
|
Thanks. Pascal Bestebroer wrote: > totally amazing stuff! > > you hit straight into my bookmarks with this site :) > > I'll be taking some things into account when optimising the dynlayer code! > > Pascal Bestebroer > pa...@dy... > http://www.dynamic-core.net > > > -----Oorspronkelijk bericht----- > > Van: dyn...@li... > > [mailto:dyn...@li...]Namens Jeff Greenberg > > Verzonden: vrijdag 23 februari 2001 19:57 > > Aan: dyn...@li... > > Onderwerp: [Dynapi-Dev] My JS Optimization Site > > > > |
From: Raides J.
<ra...@te...> - 2001-02-24 17:45:47
|
Jeff Greenberg wrote: > > Hey guys... (snip) > This is the link: > http://home.earthlink.net/~kendrasg/info/js_opt/ (snip) Ok. I have gone there and read all. It seems impressive. Just a note to clarify things a little bit. In the "Duff's device" (something I remember not having read anywhere, btw), you put this note: "** IE NOTE: Internet Explorer has much better loop optimization built in than Netscape. Using this method, you will probably see an increase in performance in IE, but it will be very minor. It makes all the difference in NS though." Well. It's not exactly a better loop optimization, but the fact that IE has, by default, JIT optimization turned on. JIT stands for "Just In Time" compilation, which means that code is precompiled the first time it's executed and then just the compiled version is executed. After the first pass, no more JavaScript code is executed in those loops. Hence the speed-up. Of course, loop optimization is done in the JIT phase. NS4.x, on the other way, is always interpreting and executing code. That's why it's so slow. It also does the annoying thing of first translating any "document.write" statements it finds on its corresponding HTML *BEFORE* doing anything with the page. So page renders are painfully slow. See http://www.teide.net/catai/subirana/reserva.htm for an example where the selects shown are dynamically generated in client side JavaScript. Use IE or NS6 to see the actual source code. Just my 2 ptas. Raides J. |
From: Eytan H. <ey...@tr...> - 2001-02-24 21:57:20
|
First of all I wanted to know if you are accepting tests! Another thing is that your great Duff dude was slower on my PIII by 1 ms. No biggie but why? 8an |
From: Eytan H. <ey...@tr...> - 2001-02-24 22:02:48
|
I think we(you) should divide the test in to two parts: * Good programming * DHTML performance What about making this a serious page with serverside scripts to submit tests and results. (I would do it but I am only fluent in ASP and ISAPI and rusty in PERL if you have a WinBox I could do it) 8an |
From: Erik A. <er...@ea...> - 2001-02-25 20:06:50
|
What made you think that MS has a JIT for JScript? Personally I thought this was one of the good news about .Net and JScript.Net. (Getting the same performance as from all other languages.) IE3+ has been using MS JVM which uses JIT but this does not mean that JScript benefits from this? Any proof / hints really apreciated. Same goes for Netscape Navigator 4 and Mozilla 5. Erik Arvidsson - WebFX.nu er...@ea... ----- Original Message ----- From: "Raides J. Rodríguez Domínguez" <ra...@te...> > Well. It's not exactly a better loop optimization, but the fact that IE > has, by default, JIT optimization turned on. JIT stands for "Just In > Time" compilation, which means that code is precompiled the first time > it's executed and then just the compiled version is executed. After the > first pass, no more JavaScript code is executed in those loops. Hence > the speed-up. Of course, loop optimization is done in the JIT phase. |
From: Raides J.
<ra...@te...> - 2001-02-26 00:14:09
|
Erik Arvidsson wrote: > > What made you think that MS has a JIT for JScript? Personally I thought this > was one of the good news about .Net and JScript.Net. (Getting the same > performance as from all other languages.) > > IE3+ has been using MS JVM which uses JIT but this does not mean that > JScript benefits from this? > > Any proof / hints really apreciated. Same goes for Netscape Navigator 4 and > Mozilla 5. > As I said to Jeff, I will check source code for the JS1.5 C source-code implementation to see how it works internally. If this, the last version for NS browsers, doesn't do any JIT, surely previous versions didn't too. About IE, I will check again when I have access to an IE4+ equipped box. At home I still have IE3, but for no use at all, and it doesn't do JIT for JavaScript, but for Java ... but who knows what does MS call "Java"?... BTW, IE3 is still faster at JavaScript (JScript in MS notation) than NS3+. Raides J. |
From: Robert R. <rra...@ya...> - 2001-02-25 20:08:56
|
The only JIT (Just-in-time) compiler I've ever heard of was for Java. But, I guess it MS could have one for JScript, but I've never heard of it. -- // Robert Rainwater On 2/25/2001, 2:57:17 PM EST, Erik wrote about "[Dynapi-Dev] JIT JavaScript (was My JS Optimization Site)": > What made you think that MS has a JIT for JScript? Personally I thought this > was one of the good news about .Net and JScript.Net. (Getting the same > performance as from all other languages.) > IE3+ has been using MS JVM which uses JIT but this does not mean that > JScript benefits from this? > Any proof / hints really apreciated. Same goes for Netscape Navigator 4 and > Mozilla 5. > Erik Arvidsson - WebFX.nu > er...@ea... > ----- Original Message ----- > From: "Raides J. Rodríguez Domínguez" <ra...@te...> >> Well. It's not exactly a better loop optimization, but the fact that IE >> has, by default, JIT optimization turned on. JIT stands for "Just In >> Time" compilation, which means that code is precompiled the first time >> it's executed and then just the compiled version is executed. After the >> first pass, no more JavaScript code is executed in those loops. Hence >> the speed-up. Of course, loop optimization is done in the JIT phase. > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev ---------------------- DynAPI Snapshots: http://dynapi.sourceforge.net/snapshot/ DynAPI Homepage: http://dynapi.sourceforge.net/ |
From: Daniel A. <dan...@ne...> - 2001-02-26 12:28:03
Attachments:
duff.html
|
Hi, Nice site, Jeff. Some interesting tricks there I hadn't thought about. I liked the Duff's Device code, although I noticed it can be improved. Here's a version of the code which doesn't have the case stuff in the main loop but can still do a custom number of iterations. On my computer I get these results in NS4.7 and similar results in IE5: Ordinary: 601 ms Duff's: 431 ms Duff's Optimized: 250 ms Of course, you'll only get a noticable speed improvement on this kind of optimization when you're doing a huge amount of iterations with a loop body which doesn't consume much time. And it's horribly unreadable code. Cheers, Daniel Jeff Greenberg wrote: > My new site (still under construction) is a collection of JavaScript > optimization tips, techniques, tests and explanations. It will deal with > speed, size and memory issues. -- Daniel Aborg <dan...@ne...> T: 0207 445 447 M: 07765 961 155 |
From: Jeff G. <je...@we...> - 2001-02-26 18:22:31
|
Very cool. Nice improvement. In a sense, any loop based on Duff's Device is going to be somewhat difficult to follow for anyone encountering it for the first time, so I wouldn't worry about that. Anyone using this kind of optimization isn't going to be terribly worried about the clarity of their code anyway! :-) I will add this to the one on my site, if that's ok with you... Jeff Greenberg je...@we... Daniel Aborg wrote: > Hi, > > Nice site, Jeff. Some interesting tricks there I hadn't thought about. > I > liked the Duff's Device code, although I noticed it can be improved. > Here's a version of the code which doesn't have the case stuff in the > main loop but can still do a custom number of iterations. On my > computer > I get these results in NS4.7 and similar results in IE5: > > Ordinary: 601 ms > Duff's: 431 ms > Duff's Optimized: 250 ms > > Of course, you'll only get a noticable speed improvement on this kind > of > optimization when you're doing a huge amount of iterations with a loop > body which doesn't consume much time. And it's horribly unreadable > code. > > Cheers, > > Daniel > > |
From: Doug M. <do...@cr...> - 2001-02-26 20:51:49
|
well, he did pass you the html.. :-) ----- Original Message ----- From: "Jeff Greenberg" <je...@we...> To: <dyn...@li...>; "Daniel Aborg" <dan...@ne...> Sent: Monday, February 26, 2001 10:22 AM Subject: Re: [Dynapi-Dev] My JS Optimization Site > Very cool. Nice improvement. > > In a sense, any loop based on Duff's Device is going to be somewhat > difficult to follow for anyone encountering it for the first time, so I > wouldn't worry about that. Anyone using this kind of optimization isn't > going to be terribly worried about the clarity of their code anyway! > :-) > > I will add this to the one on my site, if that's ok with you... > > Jeff Greenberg > je...@we... > > Daniel Aborg wrote: > > > Hi, > > > > Nice site, Jeff. Some interesting tricks there I hadn't thought about. > > I > > liked the Duff's Device code, although I noticed it can be improved. > > Here's a version of the code which doesn't have the case stuff in the > > main loop but can still do a custom number of iterations. On my > > computer > > I get these results in NS4.7 and similar results in IE5: > > > > Ordinary: 601 ms > > Duff's: 431 ms > > Duff's Optimized: 250 ms > > > > Of course, you'll only get a noticable speed improvement on this kind > > of > > optimization when you're doing a huge amount of iterations with a loop > > body which doesn't consume much time. And it's horribly unreadable > > code. > > > > Cheers, > > > > Daniel > > > > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev > --- Outgoing mail is certified Virus Free by AVG Free Edition Download at: http://www.grisoft.com/html/us_index.cfm Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.231 / Virus Database: 112 - Release Date: 2/12/01 |
From: Daniel A. <dan...@ne...> - 2001-02-28 12:51:01
|
Thanks. I made it for fun and in the hope that it'll be used, so you're welcome to put it on the website. :-) Cheers, Daniel Jeff Greenberg wrote: > > Very cool. Nice improvement. > > I will add this to the one on my site, if that's ok with you... -- Daniel Aborg <dan...@ne...> T: 0207 445 447 M: 07720 29 44 40 |