W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2009

[whatwg] Script loading and execution order for importScripts

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sat, 07 Mar 2009 15:51:53 -0500
Message-ID: <49B2DE69.8010005@mit.edu>
Oliver Hunt wrote:
> If by "compilation" you mean you're (effectively) just doing a syntax 
> check then webkit is able to this, although it has a reasonable cost 
> associated with it

"Compilation" in this case is parsing and compilation to SpiderMonkey 
bytecode.  This does include syntax checks, of course, but also an 
optimization pass (constant folding, some simple dead expression 
elimination, that sort of thing) and produces the actual object that can 
be executed (which is quite distinct from the character array that is 
input to the compilation process).

This is not a trivial cost at the moment: it's about 10-20% of the cost 
of loading and executing some of the large scripts out there which have 
all sorts of function definitions but don't immediately run all the code 
(e.g. the scripts loaded by gmail).

Received on Saturday, 7 March 2009 12:51:53 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:47 UTC