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

[whatwg] Script loading and execution order for importScripts

From: Oliver Hunt <oliver@apple.com>
Date: Sat, 7 Mar 2009 12:54:13 -0800
Message-ID: <9D063458-DEFE-4BF7-B28D-452D5D3F0635@apple.com>
Yes, i realise it does more than _just_ a syntax check, but the user  
observable effect is just the success or failure of syntax check :D


On Mar 7, 2009, at 12:51 PM, Boris Zbarsky wrote:

> 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).
> -Boris
Received on Saturday, 7 March 2009 12:54:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:10 UTC