Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <69167318.yBAuBtPbmc@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sun, 27 Oct 2013 02:37:37 +0200 User-Agent: KNode/4.10.5 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <3382075.QeW2rGUY4L@PointedEars.de> MIME-Version: 1.0 Lines: 87 NNTP-Posting-Date: 27 Oct 2013 02:37:46 CEST NNTP-Posting-Host: 4be29690.newsspool1.arcor-online.net X-Trace: DXC=Bm9_LVkcLVWmG86`U=_nC_ic==]BZ:af^4Fo<]lROoRQnkgeX?EC@@PPmZQ?n;CHJUDZm8W4\YJN\YUVHKH;GI^W@\oJa=5C:OXbJN24Rk\O[Z X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:21744 Eric Bednarz wrote: > Thomas 'PointedEars' Lahn writes: >> Eric Bednarz wrote: >>> 2) Loading a really large file is usually much less efficient than >>> loading several smaller files dynamically in parallel in most (more or >>> less) contemporary browsers. This might depend on the precise values of >>> 'several' and 'contemporary', of course. >> >> How did you get that idea? You are also not considering that the number >> of parallel HTTP requests is limited, > > ... to an average of 6 to 8 requests per hostname, these days. How did you get that idea? > We were talking about less than ten scripts. Were we? > Map that to 'usually'. If we must go down that slippery road: unfortunately, the average script- kiddie makes sure that “usually” means more than 9 by now. >> not only by HTTP/1.1 definitions, > > But also by gut feeling. You're right, I didn't consider. > >> and that even if parallel download is possible, parallel parsing is >> not. > > As you would say, this is a fallacious argument. If you load /n/ scripts > in parallel in a non-blocking way and parse them sequentially, that's > usually faster because: > > - one script can be parsed while another one downloads No, in general it cannot. As I have had to realize with regard to my code, /* part 1 */ var f = function () {}; /* part 2 */ var f2 = (function () { /* function */ var _f = f; return function () { return _f; }; }()); has a different result than /* part 1 */ var f2 = (function () { /* undefined */ var _f = f; return function () { return _f; }; }()); /* part 2 */ var f = function () {}; > - meanwhile, the DOM can be parsed, too No, it (the _document_; the DOM is an *API* instead) cannot: Client-side scripts can modify the document while it is being parsed. Therefore, it is BCP to put stylesheet references and stylesheets before client-side script references and client-side scripts (so that stylesheets can be applied while scripts are loaded and parsed), and to avoid document.write() in favor of .appendChild(). [The ES Matrix explicitly uses document.write() for backwards compatibility.] There is one exception to this rule, and that is when the (formerly, proprietary) “defer” attribute is specified on the “script” element, *and* supported (but document.write() cannot be used there). -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.